Index: ELF/Arch/Mips.cpp =================================================================== --- ELF/Arch/Mips.cpp +++ ELF/Arch/Mips.cpp @@ -188,7 +188,8 @@ } template RelType MIPS::getDynRel(RelType Type) const { - return RelativeRel; + // TODO: are there any that need to change? + return Type; } template Index: test/ELF/mips-32.s =================================================================== --- test/ELF/mips-32.s +++ test/ELF/mips-32.s @@ -48,7 +48,7 @@ # REL: Relocations [ # REL-NEXT: Section (7) .rel.dyn { # REL-NEXT: 0x20008 R_MIPS_REL32 - 0x0 -# REL-NEXT: 0x20004 R_MIPS_REL32 v2 0x0 +# REL-NEXT: 0x20004 R_MIPS_32 v2 0x0 # REL-NEXT: } # REL-NEXT: ] Index: test/ELF/mips-64.s =================================================================== --- test/ELF/mips-64.s +++ test/ELF/mips-64.s @@ -32,7 +32,7 @@ # CHECK: Relocations [ # CHECK-NEXT: Section (7) .rel.dyn { # CHECK-NEXT: 0x20010 R_MIPS_REL32/R_MIPS_64/R_MIPS_NONE - 0x0 -# CHECK-NEXT: 0x20008 R_MIPS_REL32/R_MIPS_64/R_MIPS_NONE v2 0x0 +# CHECK-NEXT: 0x20008 R_MIPS_64/R_MIPS_NONE/R_MIPS_NONE v2 0x0 # CHECK-NEXT: } # CHECK-NEXT: ] Index: test/ELF/mips-data-relocation-undef.s =================================================================== --- /dev/null +++ test/ELF/mips-data-relocation-undef.s @@ -0,0 +1,22 @@ +# REQUIRES: mips +# RUN: llvm-mc -triple=mips64-unknown-freebsd -filetype=obj %s -o %t.o +# RUN: ld.lld -shared %t.o -o %t.so +# RUN: llvm-readobj -expand-relocs -r -t %t.so | FileCheck %s + +.global foo + +.data +.global bar +bar: + .quad foo +.size bar, 8 + +#CHECK-LABEL: Relocations [ +#CHECK-NEXT: Section (7) .rel.dyn { +#CHECK-NEXT: Relocation { +#CHECK-NEXT: Offset: 0x10000 +#CHECK-NEXT: Type: R_MIPS_64/R_MIPS_NONE/R_MIPS_NONE (18) +#CHECK-NEXT: Symbol: foo +#CHECK-NEXT: Addend: 0x0 +#CHECK-NEXT: } +#CHECK-NEXT: } Index: test/ELF/rel-addend-with-rela-input.s =================================================================== --- test/ELF/rel-addend-with-rela-input.s +++ test/ELF/rel-addend-with-rela-input.s @@ -32,7 +32,7 @@ # ^--- Addend for relocation in .rel.dyn # RELA-TO-REL: Relocations [ # RELA-TO-REL-NEXT: Section ({{.+}}) .rel.dyn { -# RELA-TO-REL-NEXT: 0x10000 R_MIPS_REL32/R_MIPS_64/R_MIPS_NONE foo 0x0 +# RELA-TO-REL-NEXT: 0x10000 R_MIPS_64/R_MIPS_NONE/R_MIPS_NONE foo 0x0 # RELA-TO-REL-NEXT: } # RELA-TO-REL-NEXT: ]