Home | History | Annotate | Download | only in Object
      1 // Check that 'llvm-readobj -dyn-relocations' shows dynamic relocations
      2 // if they have REL record format.
      3 
      4 // dyn-rel.so.elf-mips
      5 // % cat test.s
      6 //   .globl  __start
      7 // __start:
      8 //   nop
      9 // 
     10 //   .data
     11 //   .type  v1,@object
     12 //   .size  v1,4
     13 // v1:
     14 //   .word 0
     15 // 
     16 //   .globl v2
     17 //   .type  v2,@object
     18 //   .size  v2,8
     19 // v2:
     20 //   .word v2+4 # R_MIPS_32 target v2 addend 4
     21 //   .word v1   # R_MIPS_32 target v1 addend 0
     22 //
     23 // % llvm-mc -filetype=obj -triple=mips-unknown-linux -o test.o test.s
     24 // % ld  -m elf32btsmip -shared -o dyn-rel.so.elf-mips test.o
     25 
     26 RUN: llvm-readobj -relocations -dyn-relocations -expand-relocs \
     27 RUN:   %p/Inputs/dyn-rel.so.elf-mips | FileCheck %s
     28 
     29 // CHECK:      Relocations [
     30 // CHECK-NEXT:   Section (6) .rel.dyn {
     31 // CHECK-NEXT:     Relocation {
     32 // CHECK-NEXT:       Offset: 0x0
     33 // CHECK-NEXT:       Type: R_MIPS_NONE (0)
     34 // CHECK-NEXT:       Symbol: - (0)
     35 // CHECK-NEXT:       Addend: 0x0
     36 // CHECK-NEXT:     }
     37 // CHECK-NEXT:     Relocation {
     38 // CHECK-NEXT:       Offset: 0x102F8
     39 // CHECK-NEXT:       Type: R_MIPS_REL32 (3)
     40 // CHECK-NEXT:       Symbol: - (0)
     41 // CHECK-NEXT:       Addend: 0x0
     42 // CHECK-NEXT:     }
     43 // CHECK-NEXT:     Relocation {
     44 // CHECK-NEXT:       Offset: 0x102F4
     45 // CHECK-NEXT:       Type: R_MIPS_REL32 (3)
     46 // CHECK-NEXT:       Symbol: v2 (9)
     47 // CHECK-NEXT:       Addend: 0x0
     48 // CHECK-NEXT:     }
     49 // CHECK-NEXT:   }
     50 // CHECK-NEXT: ]
     51 
     52 // CHECK:      Dynamic Relocations {
     53 // CHECK-NEXT:   Relocation {
     54 // CHECK-NEXT:     Offset: 0x0
     55 // CHECK-NEXT:     Type: R_MIPS_NONE (0)
     56 // CHECK-NEXT:     Symbol: -
     57 // CHECK-NEXT:     Addend: 0x0
     58 // CHECK-NEXT:   }
     59 // CHECK-NEXT:   Relocation {
     60 // CHECK-NEXT:     Offset: 0x102F8
     61 // CHECK-NEXT:     Type: R_MIPS_REL32 (3)
     62 // CHECK-NEXT:     Symbol: -
     63 // CHECK-NEXT:     Addend: 0x0
     64 // CHECK-NEXT:   }
     65 // CHECK-NEXT:   Relocation {
     66 // CHECK-NEXT:     Offset: 0x102F4
     67 // CHECK-NEXT:     Type: R_MIPS_REL32 (3)
     68 // CHECK-NEXT:     Symbol: v2
     69 // CHECK-NEXT:     Addend: 0x0
     70 // CHECK-NEXT:   }
     71 // CHECK-NEXT: }
     72