[llvm-commits] [patch] Don't relax all references to non temporary symbols

Rafael Espindola espindola at google.com
Mon Sep 20 09:40:09 PDT 2010


Currently llvm-mc will relax both jmp instructions in:

--------------------
.globl foo
        jmp bar
        jmp foo
bar:
foo:
------------------

I think that by changing HasReliableSymbolDifference to true in ELF we
should be able to avoid both relaxations. That is probably the best
thing to do, but unfortunately that is not what gnu as does. In the
above example it will relax the jump to foo, but not to bar. Matching
GNU as behavior for now makes debugging easier, so, if possible, I
would like to check something similar to the attached patch.

The patch is clearly hackish. The two ways I can think of improving it a bit are
*) Changing the isELF to something like HasScatteredGlobalSymbols. Not
sure if that helps a lot.
*) Moving the isScatteredFixupFullyResolved,
isScatteredFixupFullyResolvedSimple and isFixupFullyResolvedELF to the
backend.

Please let me know if you have any preferences.

Cheers,
-- 
Rafael Ávila de Espíndola
-------------- next part --------------
A non-text attachment was scrubbed...
Name: relax.patch
Type: text/x-patch
Size: 6164 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100920/9bad48e8/attachment.bin>


More information about the llvm-commits mailing list