This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] ARM pcrel function relocs
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 01 Dec 2006 11:41:48 +0000
- Subject: Re: [patch] ARM pcrel function relocs
- References: <200611302355.26296.paul@codesourcery.com>
On Thu, 2006-11-30 at 23:55 +0000, Paul Brook wrote:
> The ARM abi has special semantics for relocations against function symbols. To
> avoid having to duplicate this we want gas to always output relocations
> against function symbols, even when it would normally be able to resolve them
> locally.
>
> arm_fix_adjustable contains a special case for function symbols. However
> arm_force_relocation does not.
>
> This confuses md_pcrel_from_section, and results in incorrect addends for
> pc-relative relocations against local function symbols in the same section.
> One example of this is the code that gcc generates for C++ virtual function
> thunks when COMDAT sections are disabled.
>
> Global function symbols are not effected because generic_force_reloc already
> returns true for those.
>
> Patch below fixes this.
> Tested with cross to arm-none-eabi.
> Ok?
Yes, this is OK.
However, I would point out that yesterday I was listening to a user of
the tools complaining about the large increase in link times recently,
especially when dealing with large C++ applications. Leaving this to
the linker is part of that since now the linker has to deal with a lot
more information and some of the symbol processing steps are worse than
linear in the number of symbols (in addition to the extra vm needed). I
do think we need to try a bit harder to collapse unnecessary symbolic
information (and relocations) in ARM object files.
R.