Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-readobj] - Test PPC64 relocations properly.
We had a precompiled binary committed and not all of the relocations supported were tested. This patch fixes this. Differential revision: https://reviews.llvm.org/D67617 llvm-svn: 372110
- Loading branch information
George Rimar
committed
Sep 17, 2019
1 parent
82d8373
commit 5892938
Showing
2 changed files
with
258 additions
and
3 deletions.
There are no files selected for viewing
Binary file not shown.
261 changes: 258 additions & 3 deletions
261
llvm/test/tools/llvm-readobj/reloc-types-elf-ppc64.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,293 @@ | ||
## Test that llvm-readobj/llvm-readelf shows proper relocation type | ||
## Test that llvm-readobj shows proper relocation type | ||
## names and values for ppc64 target. | ||
|
||
## TODO: Use yaml2obj. obj2yaml now hangs on dumping relocs.obj.elf-ppc64 | ||
# RUN: llvm-readobj -r --expand-relocs %p/Inputs/relocs.obj.elf-ppc64 | FileCheck %s | ||
# RUN: yaml2obj %s -o %t-ppc64.o | ||
# RUN: llvm-readobj -r --expand-relocs %t-ppc64.o | FileCheck %s | ||
|
||
# CHECK: Type: R_PPC64_NONE (0) | ||
# CHECK: Type: R_PPC64_ADDR32 (1) | ||
# CHECK: Type: R_PPC64_ADDR24 (2) | ||
# CHECK: Type: R_PPC64_ADDR16 (3) | ||
# CHECK: Type: R_PPC64_ADDR16_LO (4) | ||
# CHECK: Type: R_PPC64_ADDR16_HI (5) | ||
# CHECK: Type: R_PPC64_ADDR16_HA (6) | ||
# CHECK: Type: R_PPC64_ADDR14 (7) | ||
# CHECK: Type: R_PPC64_ADDR14_BRTAKEN (8) | ||
# CHECK: Type: R_PPC64_ADDR14_BRNTAKEN (9) | ||
# CHECK: Type: R_PPC64_REL24 (10) | ||
# CHECK: Type: R_PPC64_REL14 (11) | ||
# CHECK: Type: R_PPC64_REL14_BRTAKEN (12) | ||
# CHECK: Type: R_PPC64_REL14_BRNTAKEN (13) | ||
# CHECK: Type: R_PPC64_GOT16 (14) | ||
# CHECK: Type: R_PPC64_GOT16_LO (15) | ||
# CHECK: Type: R_PPC64_GOT16_HI (16) | ||
# CHECK: Type: R_PPC64_GOT16_HA (17) | ||
# CHECK: Type: R_PPC64_GLOB_DAT (20) | ||
# CHECK: Type: R_PPC64_JMP_SLOT (21) | ||
# CHECK: Type: R_PPC64_RELATIVE (22) | ||
# CHECK: Type: R_PPC64_REL32 (26) | ||
# CHECK: Type: R_PPC64_ADDR64 (38) | ||
# CHECK: Type: R_PPC64_ADDR16_HIGHER (39) | ||
# CHECK: Type: R_PPC64_ADDR16_HIGHERA (40) | ||
# CHECK: Type: R_PPC64_ADDR16_HIGHEST (41) | ||
# CHECK: Type: R_PPC64_ADDR16_HIGHESTA (42) | ||
# CHECK: Type: R_PPC64_REL64 (44) | ||
# CHECK: Type: R_PPC64_TOC16 (47) | ||
# CHECK: Type: R_PPC64_TOC16_LO (48) | ||
# CHECK: Type: R_PPC64_TOC16_HI (49) | ||
# CHECK: Type: R_PPC64_TOC16_HA (50) | ||
# CHECK: Type: R_PPC64_TOC (51) | ||
# CHECK: Type: R_PPC64_ADDR16_DS (56) | ||
# CHECK: Type: R_PPC64_ADDR16_LO_DS (57) | ||
# CHECK: Type: R_PPC64_GOT16_DS (58) | ||
# CHECK: Type: R_PPC64_GOT16_LO_DS (59) | ||
# CHECK: Type: R_PPC64_TOC16_DS (63) | ||
# CHECK: Type: R_PPC64_TOC16_LO_DS (64) | ||
# CHECK: Type: R_PPC64_TLS (67) | ||
# CHECK: Type: R_PPC64_DTPMOD64 (68) | ||
# CHECK: Type: R_PPC64_TPREL16 (69) | ||
# CHECK: Type: R_PPC64_TPREL16_LO (70) | ||
# CHECK: Type: R_PPC64_TPREL16_HI (71) | ||
# CHECK: Type: R_PPC64_TPREL16_HA (72) | ||
# CHECK: Type: R_PPC64_TPREL64 (73) | ||
# CHECK: Type: R_PPC64_DTPREL16 (74) | ||
# CHECK: Type: R_PPC64_DTPREL16_LO (75) | ||
# CHECK: Type: R_PPC64_DTPREL16_HI (76) | ||
# CHECK: Type: R_PPC64_DTPREL16_HA (77) | ||
# CHECK: Type: R_PPC64_DTPREL64 (78) | ||
# CHECK: Type: R_PPC64_GOT_TLSGD16 (79) | ||
# CHECK: Type: R_PPC64_GOT_TLSGD16_LO (80) | ||
# CHECK: Type: R_PPC64_GOT_TLSGD16_HI (81) | ||
# CHECK: Type: R_PPC64_GOT_TLSGD16_HA (82) | ||
# CHECK: Type: R_PPC64_GOT_TLSLD16 (83) | ||
# CHECK: Type: R_PPC64_GOT_TLSLD16_LO (84) | ||
# CHECK: Type: R_PPC64_GOT_TLSLD16_HI (85) | ||
# CHECK: Type: R_PPC64_GOT_TLSLD16_HA (86) | ||
# CHECK: Type: R_PPC64_GOT_TPREL16_DS (87) | ||
# CHECK: Type: R_PPC64_GOT_TPREL16_LO_DS (88) | ||
# CHECK: Type: R_PPC64_GOT_TPREL16_HI (89) | ||
# CHECK: Type: R_PPC64_GOT_TPREL16_HA (90) | ||
# CHECK: Type: R_PPC64_GOT_DTPREL16_DS (91) | ||
# CHECK: Type: R_PPC64_GOT_DTPREL16_LO_DS (92) | ||
# CHECK: Type: R_PPC64_GOT_DTPREL16_HI (93) | ||
# CHECK: Type: R_PPC64_GOT_DTPREL16_HA (94) | ||
# CHECK: Type: R_PPC64_TPREL16_DS (95) | ||
# CHECK: Type: R_PPC64_TPREL16_LO_DS (96) | ||
# CHECK: Type: R_PPC64_TPREL16_HIGHER (97) | ||
# CHECK: Type: R_PPC64_TPREL16_HIGHERA (98) | ||
# CHECK: Type: R_PPC64_TPREL16_HIGHEST (99) | ||
# CHECK: Type: R_PPC64_TPREL16_HIGHESTA (100) | ||
# CHECK: Type: R_PPC64_DTPREL16_DS (101) | ||
# CHECK: Type: R_PPC64_DTPREL16_LO_DS (102) | ||
# CHECK: Type: R_PPC64_DTPREL16_HIGHER (103) | ||
# CHECK: Type: R_PPC64_DTPREL16_HIGHERA (104) | ||
# CHECK: Type: R_PPC64_DTPREL16_HIGHEST (105) | ||
# CHECK: Type: R_PPC64_DTPREL16_HIGHESTA (106) | ||
# CHECK: Type: R_PPC64_TLSGD (107) | ||
# CHECK: Type: R_PPC64_TLSLD (108) | ||
# CHECK: Type: R_PPC64_ADDR16_HIGH (110) | ||
# CHECK: Type: R_PPC64_ADDR16_HIGHA (111) | ||
# CHECK: Type: R_PPC64_TPREL16_HIGH (112) | ||
# CHECK: Type: R_PPC64_TPREL16_HIGHA (113) | ||
# CHECK: Type: R_PPC64_DTPREL16_HIGH (114) | ||
# CHECK: Type: R_PPC64_DTPREL16_HIGHA (115) | ||
# CHECK: Type: R_PPC64_IRELATIVE (248) | ||
# CHECK: Type: R_PPC64_REL16 (249) | ||
# CHECK: Type: R_PPC64_REL16_LO (250) | ||
# CHECK: Type: R_PPC64_REL16_HI (251) | ||
# CHECK: Type: R_PPC64_REL16_HA (252) | ||
|
||
--- !ELF | ||
FileHeader: | ||
Class: ELFCLASS64 | ||
Data: ELFDATA2MSB | ||
Type: ET_REL | ||
Machine: EM_PPC64 | ||
Sections: | ||
- Name: .rela.text | ||
Type: SHT_RELA | ||
Relocations: | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_NONE | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR32 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR24 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR16 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR16_LO | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR16_HI | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR16_HA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR14 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR14_BRTAKEN | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR14_BRNTAKEN | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_REL24 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_REL14 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_REL14_BRTAKEN | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_REL14_BRNTAKEN | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT16 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT16_LO | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT16_HI | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT16_HA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GLOB_DAT | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_JMP_SLOT | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_RELATIVE | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_REL32 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR64 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR16_HIGHER | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR16_HIGHERA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR16_HIGHEST | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR16_HIGHESTA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_REL64 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TOC16 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TOC16_LO | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TOC16_HI | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TOC16_HA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TOC | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR16_DS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR16_LO_DS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT16_DS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT16_LO_DS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TOC16_DS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TOC16_LO_DS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TLS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_DTPMOD64 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TPREL16 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TPREL16_LO | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TPREL16_HI | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TPREL16_HA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TPREL64 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_DTPREL16 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_DTPREL16_LO | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_DTPREL16_HI | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_DTPREL16_HA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_DTPREL64 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_TLSGD16 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_TLSGD16_LO | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_TLSGD16_HI | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_TLSGD16_HA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_TLSLD16 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_TLSLD16_LO | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_TLSLD16_HI | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_TLSLD16_HA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_TPREL16_DS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_TPREL16_LO_DS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_TPREL16_HI | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_TPREL16_HA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_DTPREL16_DS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_DTPREL16_LO_DS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_DTPREL16_HI | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_GOT_DTPREL16_HA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TPREL16_DS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TPREL16_LO_DS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TPREL16_HIGHER | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TPREL16_HIGHERA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TPREL16_HIGHEST | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TPREL16_HIGHESTA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_DTPREL16_DS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_DTPREL16_LO_DS | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_DTPREL16_HIGHER | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_DTPREL16_HIGHERA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_DTPREL16_HIGHEST | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_DTPREL16_HIGHESTA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TLSGD | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TLSLD | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR16_HIGH | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_ADDR16_HIGHA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TPREL16_HIGH | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_TPREL16_HIGHA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_DTPREL16_HIGH | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_DTPREL16_HIGHA | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_IRELATIVE | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_REL16 | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_REL16_LO | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_REL16_HI | ||
- Offset: 0x0000000000000000 | ||
Type: R_PPC64_REL16_HA |