[PATCH] Re-enable a hook in MCELFObjectTargetWriter to allow target-specific relocationtable sorting and use this hook for Mips.

Vladimir Stefanovic vladimir.stefanovic at imgtec.com
Tue Mar 10 09:42:30 PDT 2015


(Some comments disappeared from the previous message.)

> And it is not possible for a file to mix relocations from these sets? I.E, no file will ever have a R_MIPS16_LO16 and a R_MIPS_HI16? If that is not the case I think there is a bug in gold :-)


Well, you can have this in a .S file:

  lui  $2,%hi(sym1)

.set mips16

  li   $2,%lo(sym1)

Then relocations would be:
00000000  00000605 R_MIPS_HI16       00000000   sym1
00000004  00000669 R_MIPS16_LO16     00000000   sym1

so the first relocation wouldn't match the second.

> In the above comment, what does "match", "earlier" and "in order" mean?


'match' for a *HI16 relocation is a matching LO16 relocation, ie. the one
against the same symbol and with the appropriate *LO16 relocation type.
'earlier' means smaller offset.
'in order' is similar to our cmpRel() sorting function - apply the first rule,
and if the output isn't deterministic yet, apply the second one, etc.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7414

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list