Relocations against STN_UNDEF
Alan Modra
amodra@gmail.com
Fri Sep 24 00:12:00 GMT 2010
On Thu, Sep 23, 2010 at 05:37:01PM +0200, Thomas Schwinge wrote:
> 1469 if (ELF_R_SYM (rela.r_info) == 0)
> 1470 relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
>
> That is, if the index is zero -- should use STN_UNDEF here instead of the
> zero constant, I'd say?
Yes.
> $ "$PWD"_install/bin/*-ld -o bl_ABS bl_ABS.o
> /scratch/thomas/binutils/HEAD_build_arm-none-eabi_install/bin/arm-none-eabi-ld: warning: cannot find entry symbol _start; defaulting to 0000000000008000
> bl_ABS.o:(.text+0x0): undefined reference to `no symbol'
ARM fails because the arm backend specifically checks for undefined
local symbols. I'd say the arm backend check needs fixing (or
removing) rather than changing the common elflink code.
> I wonder why we need this code duplicated in (at least) two places; why
> do objdump and ld use different code paths for reading in relocations?
Efficiency.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list