Default entry point for ELF shared objects

Paul Koning paulkoning@comcast.net
Thu Sep 16 17:02:59 GMT 2021



> On Sep 16, 2021, at 12:54 PM, Hans-Peter Nilsson <hp@bitrange.com> wrote:
> 
> On Thu, 16 Sep 2021, Paul Koning wrote:
>> ...
>> 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.
> 
> Let me rephrase: since we *can't* say "no start address", a
> guess that is much more likely to be correct, is "the address of
> the first byte of the text *segment*" (for formats where that
> term applies) than the that of the .text *section*.  This
> because code for embedded targets is likely linked into one blob
> with the .text section being located only after other named
> sections in the text segment and the start address being the
> first address of that blob.

I see the problem.  Yes, if there is no encoding for "no address" (not even zero) then your suggestion is the best available option.

	paul



More information about the Binutils mailing list