This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: unreferenced local symbols generated in .dynsym
- From: Ian Lance Taylor <ian at airs dot com>
- To: Roland McGrath <roland at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: 23 Apr 2003 14:05:13 -0700
- Subject: Re: unreferenced local symbols generated in .dynsym
- References: <200304231913.h3NJDeR11277@magilla.sf.frob.com>
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