2018-06-27 00:58:19 +08:00
|
|
|
# REQUIRES: mips
|
2016-05-08 22:08:40 +08:00
|
|
|
# Check handling multiple MIPS N64 ABI relocations packed
|
|
|
|
# into the single relocation record.
|
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.o
|
2019-09-06 15:23:02 +08:00
|
|
|
# RUN: echo "SECTIONS { \
|
|
|
|
# RUN: . = 0x20000; .text ALIGN(0x1000) : { *(.text) } \
|
|
|
|
# RUN: . = 0x30000; .got : { *(.got) } \
|
|
|
|
# RUN: }" > %t.script
|
|
|
|
# RUN: ld.lld %t.o --script %t.script -o %t.exe
|
|
|
|
# RUN: llvm-objdump -d -s -t --print-imm-hex --no-show-raw-insn %t.exe | FileCheck %s
|
2016-05-08 22:08:40 +08:00
|
|
|
# RUN: llvm-readobj -r %t.exe | FileCheck -check-prefix=REL %s
|
|
|
|
|
2020-03-05 09:19:18 +08:00
|
|
|
# CHECK: 0000000000037ff0 l .got 0000000000000000 .hidden _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
|
|
|
|
|
|
|
# CHECK: Contents of section .rodata:
|
|
|
|
# CHECK-NEXT: {{[0-9a-f]+}} ffffffff fffe9014
|
|
|
|
# ^-- 0x21004 - 0x37ff0 = 0xfffffffffffe9014
|
|
|
|
|
2020-03-06 06:18:38 +08:00
|
|
|
# CHECK: <__start>:
|
2019-09-06 15:23:02 +08:00
|
|
|
# CHECK-NEXT: 21000: lui $gp, 0x1
|
|
|
|
# ^-- 0x21000 - 0x37ff0
|
|
|
|
# ^-- 0 - 0xffffffffffff9010
|
|
|
|
# ^-- %hi(0x16ff0)
|
2020-03-06 06:18:38 +08:00
|
|
|
# CHECK: <loc>:
|
2019-09-06 15:23:02 +08:00
|
|
|
# CHECK-NEXT: 21004: daddiu $gp, $gp, 0x6ff0
|
|
|
|
# ^-- 0x21000 - 0x37ff0
|
|
|
|
# ^-- 0 - 0xfffffffffffe9010
|
|
|
|
# ^-- %lo(0x16ff0)
|
2016-05-08 22:08:40 +08:00
|
|
|
|
|
|
|
# REL: Relocations [
|
|
|
|
# REL-NEXT: ]
|
|
|
|
|
|
|
|
.text
|
|
|
|
.global __start
|
|
|
|
__start:
|
|
|
|
lui $gp,%hi(%neg(%gp_rel(__start))) # R_MIPS_GPREL16
|
|
|
|
# R_MIPS_SUB
|
|
|
|
# R_MIPS_HI16
|
|
|
|
loc:
|
|
|
|
daddiu $gp,$gp,%lo(%neg(%gp_rel(__start))) # R_MIPS_GPREL16
|
|
|
|
# R_MIPS_SUB
|
|
|
|
# R_MIPS_LO16
|
|
|
|
|
|
|
|
.section .rodata,"a",@progbits
|
|
|
|
.gpdword(loc) # R_MIPS_GPREL32
|
|
|
|
# R_MIPS_64
|