2018-06-27 00:58:19 +08:00
|
|
|
# REQUIRES: mips
|
2015-12-16 22:45:09 +08:00
|
|
|
# Check R_MIPS_HI16 / LO16 relocations calculation against _gp_disp.
|
|
|
|
|
2019-09-07 23:44:40 +08:00
|
|
|
# RUN: echo "SECTIONS { \
|
|
|
|
# RUN: . = 0x10000; .text ALIGN(0x1000) : { *(.text) } \
|
|
|
|
# RUN: . = 0x30000; .got : { *(.got) } \
|
|
|
|
# RUN: }" > %t.script
|
2015-12-16 22:45:09 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t1.o
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
|
|
|
|
# RUN: %S/Inputs/mips-dynamic.s -o %t2.o
|
2019-09-07 23:44:40 +08:00
|
|
|
# RUN: ld.lld %t1.o %t2.o --script %t.script -o %t.exe
|
|
|
|
# RUN: llvm-objdump -d -t --no-show-raw-insn %t.exe | FileCheck %s
|
|
|
|
# RUN: ld.lld %t1.o %t2.o -shared --script %t.script -o %t.so
|
|
|
|
# RUN: llvm-objdump -d -t --no-show-raw-insn %t.so | FileCheck %s
|
2015-12-16 22:45:09 +08:00
|
|
|
|
|
|
|
.text
|
|
|
|
.globl __start
|
|
|
|
__start:
|
|
|
|
lui $t0,%hi(_gp_disp)
|
|
|
|
addi $t0,$t0,%lo(_gp_disp)
|
|
|
|
lw $v0,%call16(_foo)($gp)
|
2016-04-15 05:10:05 +08:00
|
|
|
bar:
|
|
|
|
lui $t0,%hi(_gp_disp)
|
|
|
|
addi $t0,$t0,%lo(_gp_disp)
|
2015-12-16 22:45:09 +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
|
|
|
# CHECK: SYMBOL TABLE:
|
2020-03-05 09:19:18 +08:00
|
|
|
# CHECK: 0001100c l .text 00000000 bar
|
|
|
|
# CHECK: 00037ff0 l .got 00000000 .hidden _gp
|
|
|
|
# CHECK: 00011000 g .text 00000000 __start
|
[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
|
|
|
|
2019-09-07 23:44:40 +08:00
|
|
|
# CHECK: Disassembly of section .text:
|
|
|
|
# CHECK-EMPTY:
|
2020-03-06 06:18:38 +08:00
|
|
|
# CHECK-NEXT: <__start>:
|
2019-09-07 23:44:40 +08:00
|
|
|
# CHECK-NEXT: 11000: lui $8, 2
|
|
|
|
# ^-- %hi(0x37ff0-0x11000)
|
|
|
|
# CHECK-NEXT: 11004: addi $8, $8, 28656
|
|
|
|
# ^-- %lo(0x37ff0-0x11004+4)
|
2020-03-06 06:18:38 +08:00
|
|
|
# CHECK: <bar>:
|
2019-09-07 23:44:40 +08:00
|
|
|
# CHECK-NEXT: 1100c: lui $8, 2
|
|
|
|
# ^-- %hi(0x37ff0-0x1100c)
|
|
|
|
# CHECK-NEXT: 11010: addi $8, $8, 28644
|
|
|
|
# ^-- %lo(0x37ff0-0x11010+4)
|