[patch] ARM pcrel function relocs
Richard Earnshaw
rearnsha@arm.com
Fri Dec 1 11:42:00 GMT 2006
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.
More information about the Binutils
mailing list