This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [patch] elf32-arm.c: Fix shared library creation on arm-none-symbianelf.
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Kazu Hirata <kazu at codesourcery dot com>
- Cc: binutils at sources dot redhat dot com, dan at codesourcery dot com
- Date: Tue, 26 Jul 2005 22:46:56 +0930
- Subject: Re: [patch] elf32-arm.c: Fix shared library creation on arm-none-symbianelf.
- References: <200507252017.j6PKH2Eo011516@sirius.codesourcery.com>
On Mon, Jul 25, 2005 at 01:17:02PM -0700, Kazu Hirata wrote:
> Hi,
>
> Attached is a patch to fix shared library creation on
> arm-none-symbianelf.
>
> Consider a simple object file that comes from:
>
> .comm g,4,4
>
> When I try to create a shared library with this object file, I get:
>
> ./ld-new: a.out: could not find output section .got for input section .got
> ./ld-new: final link failed: Nonrepresentable section on output
>
> The problem is that the linker wants to output _GLOBAL_OFFSET_SYMBOL_
> to the .got section, but before that happens,
> elf32_arm_size_dynamic_sections prunes the .got section by adding
> SEC_EXCLUDE to the .got section's flags.
>
> The patch fixes the problem by keeping the .got section even if it's
> empty.
>
> Tested by building i686-pc-linux-gnu X arm-none-symbianelf. I have a
> strong feeling that I am papering over a real bug elsewhere, but I
> don't know where to go from here.
You see this on symbianelf because the got header is defined to be
zero size.
/* There is no .got section for BPABI objects, and hence no header. */
#undef elf_backend_got_header_size
#define elf_backend_got_header_size 0
However, that comment makes me think you shouldn't have a
_GLOBAL_OFFSET_TABLE_ symbol either. If the comment is correct, then
perhaps you need
#define elf_backend_want_got_sym 0
--
Alan Modra
IBM OzLabs - Linux Technology Centre