This is the mail archive of the binutils@sources.redhat.com 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: unreferenced local symbols generated in .dynsym


Roland McGrath <roland at redhat dot 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


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