[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrUXnXVARO=KD+r0YV1wi2vvXF-41VS++F877HsJs1qz9Q@mail.gmail.com>
Date: Wed, 6 May 2015 23:02:10 -0700
From: Andy Lutomirski <luto@...capital.net>
To: binutils@...rceware.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Avoiding unnecessary jump relocations in gas?
AFAICT gas will produce relocations for jumps to global labels in the
same file. This doesn't seem directly harmful to me, except that, on
x86, it forces five-byte jumps instead of two-byte jumps.
This seems especially unfortunate, since even hidden and protected
symbols have this problem.
Given that many users don't want interposition support (especially the
kernel and anyone using .hidden or .protected), it would be nice to
have a command-line option to turn this off and probably also to turn
it off by default for hidden and protected symbols. Can gas do this?
I looked at the code, and this seems to be EXTERN_FORCE_RELOC, which
isn't configurable at runtime.
One safer way to fix this would be to add a new type of relocation
that represents a non-relocatable relative reference. This could be
emitted for short jumps to local symbols, would not actually be
relocated, but would generate an error if a user did something awful
in a linker script that would otherwise generate incorrect linker
output.
--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists