1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Have ARM ELF use correct reloc for "b" instr.

The condition code didn't actually matter for arm "b" instructions,
unlike "bl".  It should just use the R_ARM_JUMP24 reloc.

llvm-svn: 158722
This commit is contained in:
Jan Wen Voung 2012-06-19 16:03:02 +00:00
parent 12c1b6478a
commit fa15c02364
2 changed files with 14 additions and 6 deletions

View File

@ -178,9 +178,8 @@ unsigned ARMELFObjectWriter::GetRelocTypeInner(const MCValue &Target,
break;
}
break;
case ARM::fixup_arm_uncondbl:
case ARM::fixup_arm_blx:
case ARM::fixup_arm_uncondbranch:
case ARM::fixup_arm_uncondbl:
switch (Modifier) {
case MCSymbolRefExpr::VK_ARM_PLT:
Type = ELF::R_ARM_PLT32;
@ -192,6 +191,7 @@ unsigned ARMELFObjectWriter::GetRelocTypeInner(const MCValue &Target,
break;
case ARM::fixup_arm_condbl:
case ARM::fixup_arm_condbranch:
case ARM::fixup_arm_uncondbranch:
Type = ELF::R_ARM_JUMP24;
break;
case ARM::fixup_arm_movt_hi16:
@ -252,10 +252,8 @@ unsigned ARMELFObjectWriter::GetRelocTypeInner(const MCValue &Target,
case ARM::fixup_arm_thumb_cp:
case ARM::fixup_arm_thumb_br:
llvm_unreachable("Unimplemented");
case ARM::fixup_arm_uncondbranch:
Type = ELF::R_ARM_CALL;
break;
case ARM::fixup_arm_condbranch:
case ARM::fixup_arm_uncondbranch:
Type = ELF::R_ARM_JUMP24;
break;
case ARM::fixup_arm_movt_hi16:

View File

@ -4,6 +4,8 @@
bleq some_label
bl some_label
blx some_label
beq some_label
b some_label
// OBJ: .rel.text
// OBJ: 'r_offset', 0x00000000
@ -18,6 +20,14 @@
// OBJ-NEXT: 'r_sym', 0x000004
// OBJ-NEXT: 'r_type', 0x1c
// OBJ: 'r_offset', 0x0000000c
// OBJ-NEXT: 'r_sym', 0x000004
// OBJ-NEXT: 'r_type', 0x1d
// OBJ: 'r_offset', 0x00000010
// OBJ-NEXT: 'r_sym', 0x000004
// OBJ-NEXT: 'r_type', 0x1d
// OBJ: .symtab
// OBJ: Symbol 4
// OBJ-NEXT: some_label
// OBJ-NEXT: some_label