This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Arm local fuction symbols
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Paul Brook <paul at nowt dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 1 Apr 2006 10:29:23 -0800
- Subject: Re: [patch] Arm local fuction symbols
- References: <200604011425.48230.paul@nowt.org>
Did you send it to the wrong list by accident?
H.J.
On Sat, Apr 01, 2006 at 02:25:45PM +0100, Paul Brook wrote:
> The Arm EABI says that relocations against local symbols may only be
> substituted for a different symbol if neither of the symbols has type
> STT_FUNC, both are Arm functions or both are Thumb functions.
>
> This means relocations against function symbols must not be converted into
> relocations against section symbols.
>
> The patch below tweaks arm_fix_adjustable to achieve this.
>
> Tested with cross to arm-none-eabi.
> Ok?
>
> Paul
>
> 2005-04-01 Paul Brook <paul@codesourcery.com>
>
> * config/tc-arm.c (arm_fix_adjustable): Return 0 for function symbols.
>
> Index: gas/config/tc-arm.c
> ===================================================================
> RCS file: /var/cvsroot/src-cvs/src/gas/config/tc-arm.c,v
> retrieving revision 1.252
> diff -u -p -r1.252 tc-arm.c
> --- gas/config/tc-arm.c 21 Mar 2006 22:52:06 -0000 1.252
> +++ gas/config/tc-arm.c 1 Apr 2006 13:04:46 -0000
> @@ -12575,9 +12575,9 @@ arm_fix_adjustable (fixS * fixP)
> #endif
>
> #ifdef OBJ_ELF
> -/* Relocations against Thumb function names must be left unadjusted,
> - so that the linker can use this information to correctly set the
> - bottom bit of their addresses. The MIPS version of this function
> +/* Relocations against function names must be left unadjusted,
> + so that the linker can use this information to generate interworking
> + stubs. The MIPS version of this function
> also prevents relocations that are mips-16 specific, but I do not
> know why it does this.
>
> @@ -12594,6 +12594,10 @@ arm_fix_adjustable (fixS * fixP)
> if (fixP->fx_addsy == NULL)
> return 1;
>
> + /* Preserve reloactions against symbols with function type. */
> + if (symbol_get_bfdsym (fixP->fx_addsy)->flags & BSF_FUNCTION)
> + return 0;
> +
> if (THUMB_IS_FUNC (fixP->fx_addsy)
> && fixP->fx_subsy == NULL)
> return 0;