This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH][ARM] Fix handling of GOT_PREL in gas.
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Doug Kwan (éæå) <dougkwan at google dot com>
- Cc: binutils <binutils at sourceware dot org>, Nick Clifton <nickc at redhat dot com>
- Date: Thu, 16 Sep 2010 10:24:57 +0100
- Subject: Re: [PATCH][ARM] Fix handling of GOT_PREL in gas.
- References: <AANLkTi=Dms+uMmLe9ecX00O=_fN31sHNxRJMeQmrYOkS@mail.gmail.com>
On Thu, 2010-09-16 at 01:44 -0700, Doug Kwan (éæå) wrote:
> Hi
>
> This patch fixes a problem in which gas fails to assemble data
> expression in the form:
>
> symbol(GOT_PREL) + (. - (.LPIC0 + 4))
>
> where .LPIC0 is a local label defined in the same function after the
> data expression. Currently, LPIC0 is undefined when the data
> expression is processed and that causes an error in the function
> expr() because the two operands of the addition have different
> segments. The patch adds code to handle this situation. This is
> tested by the running the gas test suite and the new test case in this
> patch.
>
> -Doug
>
> gas/ChangeLog:
> 2010-09-16 Doug Kwan <dougkwan@google.com>
>
> * config/tc-arm.c (s_arm_elf_cons): Handle R_ARM_GOT_PREL specially.
>
> gas/testsuite/ChangeLog:
>
> 2010-09-16 Doug Kwan <dougkwan@google.com>
>
> * gas/arm/got_prel2.d: New.
> * gas/arm/got_prel2.s: New.
This really sounds to me like something that should be handled in a more
generic way than a special-case hack in the back-end.
R.