2018-06-27 00:58:19 +08:00
|
|
|
# REQUIRES: mips
|
2017-02-15 16:33:03 +08:00
|
|
|
# Check writing updated addend for R_MIPS_GOT16 relocation,
|
|
|
|
# when produce a relocatable output.
|
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux -o %t.o %s
|
|
|
|
# RUN: ld.lld -r -o %t %t.o %t.o
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump -d -r --no-show-raw-insn %t | FileCheck --check-prefix=OBJ %s
|
2017-02-15 16:33:03 +08:00
|
|
|
# RUN: ld.lld -shared -o %t.so %t
|
2019-09-07 23:44:40 +08:00
|
|
|
# RUN: llvm-objdump -d -t --print-imm-hex --no-show-raw-insn %t.so \
|
|
|
|
# RUN: | FileCheck -check-prefix=SO %s
|
2017-02-15 16:33:03 +08:00
|
|
|
|
|
|
|
# OBJ: Disassembly of section .text:
|
2019-05-01 18:40:48 +08:00
|
|
|
# OBJ-EMPTY:
|
2020-03-06 06:18:38 +08:00
|
|
|
# OBJ-NEXT: <.text>:
|
2019-09-07 23:44:40 +08:00
|
|
|
# OBJ-NEXT: lw $25, 0($gp)
|
|
|
|
# OBJ-NEXT: 00000000: R_MIPS_GOT16 .data
|
|
|
|
# OBJ-NEXT: addiu $4, $25, 0
|
|
|
|
# OBJ-NEXT: 00000004: R_MIPS_LO16 .data
|
|
|
|
# OBJ: lw $25, 0($gp)
|
|
|
|
# OBJ-NEXT: 00000010: R_MIPS_GOT16 .data
|
|
|
|
# OBJ-NEXT: addiu $4, $25, 16
|
|
|
|
# OBJ-NEXT: 00000014: R_MIPS_LO16 .data
|
2017-02-15 16:33:03 +08:00
|
|
|
|
[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.
I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly
Reviewers: jhenderson, justice_adams, grimar, ychen, espindola
Reviewed By: jhenderson
Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68066
llvm-svn: 373671
2019-10-04 06:01:08 +08:00
|
|
|
# SO: SYMBOL TABLE
|
2020-03-05 09:19:18 +08:00
|
|
|
# SO: {{0*}}[[D1:[0-9a-f]{1,4}]] l .data {{0+}} data
|
|
|
|
# SO: {{0*}}[[D2:[0-9a-f]{1,4}]] l .data {{0+}} data
|
[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.
I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly
Reviewers: jhenderson, justice_adams, grimar, ychen, espindola
Reviewed By: jhenderson
Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68066
llvm-svn: 373671
2019-10-04 06:01:08 +08:00
|
|
|
|
2017-02-15 16:33:03 +08:00
|
|
|
# SO: Disassembly of section .text:
|
2019-05-01 18:40:48 +08:00
|
|
|
# SO-EMPTY:
|
2020-03-06 06:18:38 +08:00
|
|
|
# SO-NEXT: <.text>:
|
2019-09-07 23:44:40 +08:00
|
|
|
# SO-NEXT: lw $25, -0x7fe8($gp)
|
[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.
I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly
Reviewers: jhenderson, justice_adams, grimar, ychen, espindola
Reviewed By: jhenderson
Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68066
llvm-svn: 373671
2019-10-04 06:01:08 +08:00
|
|
|
# SO-NEXT: addiu $4, $25, 0x[[D1]]
|
2019-09-07 23:44:40 +08:00
|
|
|
# SO: lw $25, -0x7fe8($gp)
|
[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.
I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly
Reviewers: jhenderson, justice_adams, grimar, ychen, espindola
Reviewed By: jhenderson
Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68066
llvm-svn: 373671
2019-10-04 06:01:08 +08:00
|
|
|
# SO-NEXT: addiu $4, $25, 0x[[D2]]
|
2017-02-15 16:33:03 +08:00
|
|
|
|
|
|
|
.text
|
|
|
|
lw $t9, %got(.data)($gp)
|
|
|
|
addiu $a0, $t9, %lo(.data)
|
|
|
|
|
|
|
|
.data
|
|
|
|
data:
|
|
|
|
.word 0
|