llvm.org GIT mirror llvm / d92c843
[yaml2obj] Support ELF x86 relocations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208228 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Atanasyan 6 years ago
2 changed file(s) with 86 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
569569 ECase(R_HEX_TPREL_16_X)
570570 ECase(R_HEX_TPREL_11_X)
571571 break;
572 case ELF::EM_386:
573 ECase(R_386_NONE)
574 ECase(R_386_32)
575 ECase(R_386_PC32)
576 ECase(R_386_GOT32)
577 ECase(R_386_PLT32)
578 ECase(R_386_COPY)
579 ECase(R_386_GLOB_DAT)
580 ECase(R_386_JUMP_SLOT)
581 ECase(R_386_RELATIVE)
582 ECase(R_386_GOTOFF)
583 ECase(R_386_GOTPC)
584 ECase(R_386_32PLT)
585 ECase(R_386_TLS_TPOFF)
586 ECase(R_386_TLS_IE)
587 ECase(R_386_TLS_GOTIE)
588 ECase(R_386_TLS_LE)
589 ECase(R_386_TLS_GD)
590 ECase(R_386_TLS_LDM)
591 ECase(R_386_16)
592 ECase(R_386_PC16)
593 ECase(R_386_8)
594 ECase(R_386_PC8)
595 ECase(R_386_TLS_GD_32)
596 ECase(R_386_TLS_GD_PUSH)
597 ECase(R_386_TLS_GD_CALL)
598 ECase(R_386_TLS_GD_POP)
599 ECase(R_386_TLS_LDM_32)
600 ECase(R_386_TLS_LDM_PUSH)
601 ECase(R_386_TLS_LDM_CALL)
602 ECase(R_386_TLS_LDM_POP)
603 ECase(R_386_TLS_LDO_32)
604 ECase(R_386_TLS_IE_32)
605 ECase(R_386_TLS_LE_32)
606 ECase(R_386_TLS_DTPMOD32)
607 ECase(R_386_TLS_DTPOFF32)
608 ECase(R_386_TLS_TPOFF32)
609 ECase(R_386_TLS_GOTDESC)
610 ECase(R_386_TLS_DESC_CALL)
611 ECase(R_386_TLS_DESC)
612 ECase(R_386_IRELATIVE)
613 ECase(R_386_NUM)
614 break;
572615 default:
573616 llvm_unreachable("Unsupported architecture");
574617 }
0 # RUN: yaml2obj -format=elf %s > %t
1 # RUN: llvm-readobj -r %t | FileCheck %s
2
3 # CHECK: Relocations [
4 # CHECK-NEXT: Section (2) .rel.text {
5 # CHECK-NEXT: 0x0 R_386_32 main 0x0
6 # CHECK-NEXT: }
7 # CHECK-NEXT: ]
8
9 FileHeader:
10 Class: ELFCLASS32
11 Data: ELFDATA2LSB
12 Type: ET_REL
13 Machine: EM_386
14 Sections:
15 - Type: SHT_PROGBITS
16 Name: .text
17 Type: SHT_PROGBITS
18 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
19 AddressAlign: 0x04
20 Content: 0000000000000000
21 - Type: SHT_REL
22 Name: .rel.text
23 Type: SHT_REL
24 Link: .symtab
25 Info: .text
26 AddressAlign: 0x04
27 Relocations:
28 - Offset: 0
29 Symbol: main
30 Type: R_386_32
31
32 Symbols:
33 Local:
34 - Name: .text
35 Type: STT_SECTION
36 Section: .text
37
38 Global:
39 - Name: main
40 Type: STT_FUNC
41 Section: .text
42 Size: 0x08