unreferenced local symbols generated in .dynsym

Ian Lance Taylor ian@airs.com
Wed Apr 23 21:05:00 GMT 2003


Roland McGrath <roland@redhat.com> writes:

> I am probably missing something.  I don't see why section symbols are ever
> useful in .dynsym.  The layout is fixed by the time that's being made, so
> relocs to sections can be converted to R_*_RELATIVE.  If there are relocs
> of other types that require a symbol and can't be converted (non-wordsize
> relocs for some architectures and so forth), then they can still be
> converted to be relative to a single local symbol in .dynsym.  

Yes, the only issue is relocs which can not be converted to RELATIVE,
which is why it is primarily an issue when non-PIC objects are
included in a shared library.

You're right, it is possible to use a local symbol in .dynsym.
However, if you need one such symbol, you probably need more than one,
so why not use a section relative reloc?  Either way, we need some
sort of data structure to decide how many such symbols are required by
the time of size_dynamic_sections().  The information needs to be
computed in the processor specific check_relocs() routine, and used by
_bfd_elf_link_renumber_dynsyms() (or equivalent) and the the processor
specific relocate_section() routine.

Ian



More information about the Binutils mailing list