public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Paul Koning <paulkoning@comcast.net>
To: Hans-Peter Nilsson <hp@bitrange.com>
Cc: Florian Weimer <fweimer@redhat.com>, binutils <binutils@sourceware.org>
Subject: Re: Default entry point for ELF shared objects
Date: Thu, 16 Sep 2021 12:39:01 -0400	[thread overview]
Message-ID: <F273B8F0-8940-4D3F-B3D8-FB0B7FBFEA70@comcast.net> (raw)
In-Reply-To: <alpine.BSF.2.20.16.2109161108320.54387@arjuna.pair.com>



> On Sep 16, 2021, at 11:14 AM, Hans-Peter Nilsson <hp@bitrange.com> wrote:
> 
> On Thu, 16 Sep 2021, Florian Weimer via Binutils wrote:
> 
>> * Fangrui Song:
>> 
>>> ...
>>> This behavior is documented at https://sourceware.org/binutils/docs/ld/Entry-Point.html
>>> 
>>> "the address of the first byte of the ?.text? section, if present;"
>>> 
>>> The rule is quite ad-hoc and I'd support the removal.
>> 
>> I saw that.  I still wonder where it came from originally.  It seems
>> more like something for a bare-metal target.  Maybe it can be kept for
>> those,
> 
> Even if so, IMHO it should be updated to be "the text segment"
> or words to that effect, as the .text *section* is likely just
> main code located after .startup or .init or similar.

A default entry point really doesn't make any sense for any target, bare metal or otherwise.  Yes, it's possible such a random guess is the right answer some of the time, but clearly any build can always supply an explicit start address -- and in my view that should be required.

As an example, the DEC object format has a special code point meaning "no start address", and that is the default.

	paul


  reply	other threads:[~2021-09-16 16:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13  7:55 Florian Weimer
2021-09-15 16:49 ` Fangrui Song
2021-09-16  5:01   ` Florian Weimer
2021-09-16  7:41     ` Andreas Schwab
2021-09-16 15:14     ` Hans-Peter Nilsson
2021-09-16 16:39       ` Paul Koning [this message]
2021-09-16 16:54         ` Hans-Peter Nilsson
2021-09-16 17:01           ` Florian Weimer
2021-09-16 17:02           ` Paul Koning
2021-09-17  5:40 dvalin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F273B8F0-8940-4D3F-B3D8-FB0B7FBFEA70@comcast.net \
    --to=paulkoning@comcast.net \
    --cc=binutils@sourceware.org \
    --cc=fweimer@redhat.com \
    --cc=hp@bitrange.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).