lkml.org 
[lkml]   [2015]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectAvoiding 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


    \
     
     \ /
      Last update: 2015-05-07 08:41    [W:4.113 / U:0.352 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site