This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Relocations against STN_UNDEF
- From: Alan Modra <amodra at gmail dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 24 Sep 2010 09:42:35 +0930
- Subject: Re: Relocations against STN_UNDEF
- References: <87pqw4v5cy.fsf@dirichlet.schwinge.homeip.net>
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