llvm.org GIT mirror llvm / 4a2a5df
[mips][ias] N32/N64 must not sort the relocation table. Doing so changes the evaluation order for relocation composition. Patch By: Daniel Sanders Reviewers: vkalintiris, atanasyan Differential Revision: https://reviews.llvm.org/D26401 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288666 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Dardis 2 years ago
2 changed file(s) with 17 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
418418 /// always match using the expressions from the source.
419419 void MipsELFObjectWriter::sortRelocs(const MCAssembler &Asm,
420420 std::vector &Relocs) {
421
422 // We do not need to sort the relocation table for RELA relocations which
423 // N32/N64 uses as the relocation addend contains the value we require,
424 // rather than it being split across a pair of relocations.
425 if (hasRelocationAddend())
426 return;
427
421428 if (Relocs.size() < 2)
422429 return;
423430
4242 # OBJ-N32: 0000: 00000000 00000000 00000000
4343 # OBJ-N32-LABEL: }
4444 # OBJ-N32-LABEL: Relocations [
45
46 # OBJ-N32: 0x4 R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE .text 0x0
4547 # OBJ-N32: 0x0 R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE .text 0x4
46 # OBJ-N32: 0x4 R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE .text 0x0
4748 # OBJ-N32: 0x8 R_MIPS_32/R_MIPS_NONE/R_MIPS_NONE .text 0x8
4849 # OBJ-N32: 0xC R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE - 0x0
50
51 # FIXME:This is the correct output for reference.
52
53 # OBJ-N32-FIXME: 0x4 R_MIPS_NONE .text 0x0
54 # OBJ-N32-FIXME: 0x0 R_MIPS_NONE .text 0x4
55 # OBJ-N32-FIXME: 0x8 R_MIPS_32 .text 0x8
56 # OBJ-N32-FIXME: 0xC R_MIPS_NONE - 0x0
4957
5058 # OBJ-N64-LABEL: Name: .text
5159 # OBJ-N64: 0000: 00000000 00000000 00000000
5260 # OBJ-N64-LABEL: }
5361 # OBJ-N64-LABEL: Relocations [
62 # OBJ-N64: 0x4 R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE .text 0x0
5463 # OBJ-N64: 0x0 R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE .text 0x4
55 # OBJ-N64: 0x4 R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE .text 0x0
5664 # OBJ-N64: 0x8 R_MIPS_32/R_MIPS_NONE/R_MIPS_NONE .text 0x8
5765 # OBJ-N64: 0xC R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE - 0x0