2018-06-27 00:58:19 +08:00
|
|
|
# REQUIRES: mips
|
2015-12-25 21:02:13 +08:00
|
|
|
# Check R_MIPS_GPREL32 relocation calculation.
|
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
|
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 %t.o
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump -s --section=.rodata -t %t.so | FileCheck %s
|
2015-12-25 21:02:13 +08:00
|
|
|
|
|
|
|
.text
|
|
|
|
.globl __start
|
|
|
|
__start:
|
|
|
|
lw $t0,%call16(__start)($gp)
|
|
|
|
foo:
|
|
|
|
nop
|
|
|
|
bar:
|
|
|
|
nop
|
|
|
|
|
|
|
|
.section .rodata, "a"
|
|
|
|
v1:
|
|
|
|
.gpword foo
|
|
|
|
.gpword bar
|
|
|
|
|
|
|
|
# CHECK: SYMBOL TABLE:
|
2020-03-05 09:19:18 +08:00
|
|
|
# CHECK: 00020008 l .text 00000000 bar
|
|
|
|
# CHECK: 00020004 l .text 00000000 foo
|
|
|
|
# CHECK: 00028000 l .got 00000000 .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: 1000 ffff8004 ffff8008
|
|
|
|
# ^ 0x20004 - 0x28000
|
|
|
|
# ^ 0x20008 - 0x28000
|