This is the mail archive of the
mailing list for the binutils project.
Re: st_shndx for ELF DSOs
- To: Jakub Jelinek <jakub at redhat dot com>
- Subject: Re: st_shndx for ELF DSOs
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- Date: 23 May 2001 18:16:12 +0100
- Cc: binutils at sources dot redhat dot com
- References: <20010517165028.H596@sunsite.ms.mff.cuni.cz>
> Something like marking the initial . = assignment in the linker script with
> RELOCATABLE(. = 0x...... + SIZE_OF_HEADERS) and then any symbol which would
> get assigned a RELOCATABLE address (e.g. depend on `.' if `.' depends on
> something RELOCATABLE) would be put into this special section and not
> absolute_section (that section would be actually equal to absolute_section
> unless doing DSO final link). This special section would resolve into
> closest output section's st_shndx.
So essentially you are proposing that the linker create a special
section which could be used as the value for the st_shndx index for
any symbol which is present in the output, is intended to be
relocatable, and which does not already have a section associated with
How could such symbols exist ? ie How can a symbol be relocatable and
yet not be referencing something in one of the sections of the output?
The __start_* and __stop_* symbols that you mention for example are
associated with the being and end addresses of particular sections, so
presumably their st_shndx ought to point to their particular section.
I think that I agree that only symbols that are truly absolute should
have SHN_ABS for their index, but I am not sure that the linker should
be creating a special section for the others. I think it ought to be
setting their section index appropriately.