mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
5b34d5a3c7
For COFF and MachO, sections semantically have relocations that apply to them. That is not the case on ELF. In relocatable objects (.o), a section with relocations in ELF has offsets to another section where the relocations should be applied. In dynamic objects and executables, relocations don't have an offset, they have a virtual address. The section sh_info may or may not point to another section, but that is not actually used for resolving the relocations. This patch exposes that in the ObjectFile API. It has the following advantages: * Most (all?) clients can handle this more efficiently. They will normally walk all relocations, so doing an effort to iterate in a particular order doesn't save time. * llvm-readobj now prints relocations in the same way the native readelf does. * probably most important, relocations that don't point to any section are now visible. This is the case of relocations in the rela.dyn section. See the updated relocation-executable.test for example. llvm-svn: 182908
13 lines
378 B
ArmAsm
13 lines
378 B
ArmAsm
// RUN: llvm-mc -triple=aarch64-none-linux-gnu -filetype=obj %s -o - | \
|
|
// RUN: llvm-readobj -r | FileCheck -check-prefix=OBJ %s
|
|
|
|
b somewhere
|
|
bl somewhere
|
|
|
|
// OBJ: Relocations [
|
|
// OBJ-NEXT: Section (2) .rela.text {
|
|
// OBJ-NEXT: 0x0 R_AARCH64_JUMP26 somewhere 0x0
|
|
// OBJ-NEXT: 0x4 R_AARCH64_CALL26 somewhere 0x0
|
|
// OBJ-NEXT: }
|
|
// OBJ-NEXT: ]
|