Home | History | Annotate | Download | only in Object
      1 # RUN: yaml2obj %s | llvm-readobj -sections -relocations - | FileCheck %s
      2 
      3 !ELF
      4 FileHeader: !FileHeader
      5   Class: ELFCLASS32
      6   Data: ELFDATA2MSB
      7   Type: ET_REL
      8   Machine: EM_MIPS
      9 
     10 Sections:
     11 - Name: .text
     12   Type: SHT_PROGBITS
     13   Content: "0000000000000000"
     14   AddressAlign: 16
     15   Flags: [SHF_ALLOC]
     16 
     17 - Name: .rel.text
     18   Type: SHT_REL
     19   Info: .text
     20   AddressAlign: 4
     21   Relocations:
     22     - Offset: 0x1
     23       Symbol: glob1
     24       Type: R_MIPS_32
     25     - Offset: 0x1
     26       Symbol: glob2
     27       Type: R_MIPS_CALL16
     28     - Offset: 0x2
     29       Symbol: loc1
     30       Type: R_MIPS_LO16
     31 
     32 - Name: .rela.text
     33   Type: SHT_RELA
     34   Link: .symtab
     35   Info: .text
     36   AddressAlign: 4
     37   Relocations:
     38     - Offset: 0x1
     39       Addend: 1
     40       Symbol: glob1
     41       Type: R_MIPS_32
     42     - Offset: 0x1
     43       Addend: 2
     44       Symbol: glob2
     45       Type: R_MIPS_CALL16
     46     - Offset: 0x2
     47       Addend: 3
     48       Symbol: loc1
     49       Type: R_MIPS_LO16
     50 
     51 Symbols:
     52   Local:
     53     - Name: loc1
     54     - Name: loc2
     55   Global:
     56     - Name: glob1
     57       Section: .text
     58       Value: 0x0
     59       Size: 4
     60     - Name: glob2
     61   Weak:
     62     - Name: weak1
     63 
     64 # CHECK:        Section {
     65 # CHECK-NEXT:     Index: 0
     66 # CHECK:        }
     67 # CHECK:        Section {
     68 # CHECK-NEXT:     Index: 1
     69 # CHECK-NEXT:     Name: .text (16)
     70 # CHECK:        }
     71 # CHECK-NEXT:   Section {
     72 # CHECK-NEXT:     Index: 2
     73 # CHECK-NEXT:     Name: .rel.text (1)
     74 # CHECK-NEXT:     Type: SHT_REL (0x9)
     75 # CHECK-NEXT:     Flags [ (0x0)
     76 # CHECK-NEXT:     ]
     77 # CHECK-NEXT:     Address: 0x0
     78 # CHECK-NEXT:     Offset: 0x{{[0-9A-F]+}}
     79 # CHECK-NEXT:     Size: 24
     80 # CHECK-NEXT:     Link: 4
     81 # CHECK-NEXT:     Info: 1
     82 # CHECK-NEXT:     AddressAlignment: 4
     83 # CHECK-NEXT:     EntrySize: 8
     84 # CHECK-NEXT:   }
     85 # CHECK-NEXT:   Section {
     86 # CHECK-NEXT:     Index: 3
     87 # CHECK-NEXT:     Name: .rela.text (11)
     88 # CHECK-NEXT:     Type: SHT_RELA (0x4)
     89 # CHECK-NEXT:     Flags [ (0x0)
     90 # CHECK-NEXT:     ]
     91 # CHECK-NEXT:     Address: 0x0
     92 # CHECK-NEXT:     Offset: 0x{{[0-9A-F]+}}
     93 # CHECK-NEXT:     Size: 36
     94 # CHECK-NEXT:     Link: 4
     95 # CHECK-NEXT:     Info: 1
     96 # CHECK-NEXT:     AddressAlignment: 4
     97 # CHECK-NEXT:     EntrySize: 12
     98 # CHECK-NEXT:   }
     99 # CHECK-NEXT:   Section {
    100 # CHECK-NEXT:     Index: 4
    101 # CHECK-NEXT:     Name: .symtab (40)
    102 # CHECK:        }
    103 # CHECK-NEXT:   Section {
    104 # CHECK-NEXT:     Index: 5
    105 # CHECK-NEXT:     Name: .strtab (32)
    106 # CHECK:        }
    107 # CHECK:        Relocations [
    108 # CHECK-NEXT:     Section (2) .rel.text {
    109 # CHECK-NEXT:       0x1 R_MIPS_32 glob1 0x0
    110 # CHECK-NEXT:       0x1 R_MIPS_CALL16 glob2 0x0
    111 # CHECK-NEXT:       0x2 R_MIPS_LO16 loc1 0x0
    112 # CHECK-NEXT:     }
    113 # CHECK-NEXT:     Section (3) .rela.text {
    114 # CHECK-NEXT:       0x1 R_MIPS_32 glob1 0x1
    115 # CHECK-NEXT:       0x1 R_MIPS_CALL16 glob2 0x2
    116 # CHECK-NEXT:       0x2 R_MIPS_LO16 loc1 0x3
    117 # CHECK-NEXT:     }
    118 # CHECK-NEXT:   ]
    119