This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Section symbols not getting created. Bug? Is attached patch correct fix?


On 2011-04-07 01:36, Alan Modra wrote:
What was the rationale for making this breaking change in the first place?
Avoiding useless clutter in the symbol table.
Well, I think this is a case where the baby was thrown out with the
bath water.  I would have thought that backwards capability would
have been provided with this change.
I don't recall anyone else complaining, and the change happened four
years ago.

As I remarked in another post in this thread, in FreeBSD we just slacked at bit, and got years behind on binutils. :)

That said, I agree the linker should eliminate unreferenced symbols,
since they are normally a waste of space, make loading slower, etc.  The
linker set stuff in *BSD is simply a special case, where we would always
like to keep some symbols.


I do think that asking for __start_* and __stop_* to always be defined
for orphan sections is a rather odd requirement.  What exactly do you
need them for?  Surely not the dynamic loader?

Not the userspace dynamic loader, but the kernel's loader for modules. Some module metadata is stored in special sections, and the loader uses the __start and __stop symbols to get their addresses.

Note this is probably historical, and the loader should maybe be fixed
to just use the addresses from the ELF headers directly, but for now, we
still depend on those symbols being there...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]