2018-06-27 00:58:19 +08:00
|
|
|
# REQUIRES: mips
|
2016-09-29 20:58:48 +08:00
|
|
|
# Check that relocatable object produced by LLD has zero gp0 value.
|
2016-07-27 05:11:34 +08:00
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
|
2016-10-04 16:24:25 +08:00
|
|
|
# RUN: ld.lld -r -o %t-rel.o %t.o
|
2019-10-03 20:08:04 +08:00
|
|
|
# RUN: llvm-readobj -A %t-rel.o | FileCheck --check-prefix=REL %s
|
2016-10-04 16:24:25 +08:00
|
|
|
|
2019-09-07 23:44:40 +08:00
|
|
|
# RUN: echo "SECTIONS { \
|
|
|
|
# RUN: .rodata ALIGN(0x1000) : { *(.rodata) } \
|
|
|
|
# RUN: . = 0x20000; .text : { *(.text) } \
|
|
|
|
# RUN: }" > %t.script
|
|
|
|
# RUN: ld.lld -shared --script %t.script -o %t.so %S/Inputs/mips-gp0-non-zero.o
|
2016-07-27 05:11:34 +08:00
|
|
|
# RUN: llvm-objdump -s -t %t.so | FileCheck --check-prefix=DUMP %s
|
2016-10-04 16:24:25 +08:00
|
|
|
|
|
|
|
# REL: GP: 0x0
|
|
|
|
|
2016-07-27 05:11:34 +08:00
|
|
|
# DUMP: SYMBOL TABLE:
|
2020-03-05 09:19:18 +08:00
|
|
|
# DUMP: 00020008 l .text 00000000 bar
|
|
|
|
# DUMP: 00020004 l .text 00000000 foo
|
|
|
|
# DUMP: 00028000 l .got 00000000 .hidden _gp
|
2016-07-27 05:11:34 +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
|
|
|
# DUMP: Contents of section .rodata:
|
|
|
|
# DUMP: 1000 fffffff4 fffffff8
|
|
|
|
# ^ 0x20004 + 0x7ff0 - 0x28000
|
|
|
|
# ^ 0x20008 + 0x7ff0 - 0x28000
|
|
|
|
|
2016-07-27 05:11:34 +08:00
|
|
|
.text
|
|
|
|
.global __start
|
|
|
|
__start:
|
|
|
|
lw $t0,%call16(__start)($gp)
|
|
|
|
foo:
|
|
|
|
nop
|
|
|
|
bar:
|
|
|
|
nop
|
|
|
|
|
|
|
|
.section .rodata, "a"
|
|
|
|
v:
|
|
|
|
.gpword foo
|
|
|
|
.gpword bar
|