Relocation avoidance for function pointers

Florian Weimer fweimer@redhat.com
Mon Nov 7 14:03:00 GMT 2016


On 11/05/2016 01:37 AM, Jeff Law wrote:

>> Quite a few targets support symbol differences in relocations, as long
>> as they are contained within the same module.  So even if some
>> relaxation is going on, function pointer differences would still work.

> Really?  When I looked at this many years ago, none did.  Hacking it for
> the PA (which had proper reloc support for difference of symbols) was
> painful.

Uh-oh.  Someone mentioned internally that there are other targets now 
which allow this.  I tried to generate some object files which use this 
latitude, but I failed, mainly because I couldn't GCC to emit any 
instructions whose width changed after linking.

In any case, I still think this feature is sufficiently useful to expose 
it to programmers even if it is not completely portable.

Florian



More information about the Gcc-help mailing list