2 # Check MIPS specific .dynamic section entries.
4 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
5 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %p/Inputs/mips-dynamic.s -o %td.o
6 # RUN: ld.lld -shared %td.o -o %td.so
8 # RUN: ld.lld %t.o %td.so -o %t.exe
9 # RUN: llvm-readobj --sections --dynamic-table %t.exe \
10 # RUN: | FileCheck -check-prefixes=EXE,NOPIE %s
12 # RUN: ld.lld -pie %t.o %td.so -o %t.so
13 # RUN: llvm-readobj --sections --dyn-syms --dynamic-table %t.so \
14 # RUN: | FileCheck -check-prefixes=EXE,PIE %s
16 # RUN: ld.lld %t.o --image-base=0x123000 %td.so -o %t.exe
17 # RUN: llvm-readobj --sections --dynamic-table %t.exe \
18 # RUN: | FileCheck -check-prefix=IMAGE_BASE %s
20 # RUN: ld.lld -shared %t.o %td.so -o %t.so
21 # RUN: llvm-readobj --sections --dyn-syms --dynamic-table %t.so \
22 # RUN: | FileCheck -check-prefix=DSO %s
26 # EXE-NEXT: Type: SHT_DYNAMIC
31 # EXE-NEXT: Type: SHT_PROGBITS
36 # EXE-NEXT: Address: [[RLDMAPADDR:0x[0-9a-f]+]]
40 # EXE-NEXT: Type: SHT_PROGBITS
41 # EXE-NEXT: Flags [ (0x10000003)
43 # EXE-NEXT: SHF_MIPS_GPREL
46 # EXE-NEXT: Address: [[GOTADDR:0x[0-9a-f]+]]
51 # PIE: DynamicSection [
52 # PIE-NEXT: Tag Type Name/Value
53 # PIE: 0x00000004 HASH 0x{{[0-9A-F]+}}
54 # PIE-NEXT: 0x70000001 MIPS_RLD_VERSION 1
55 # PIE-NEXT: 0x70000005 MIPS_FLAGS NOTPOT
56 # PIE-NEXT: 0x70000006 MIPS_BASE_ADDRESS 0x0
57 # PIE-NEXT: 0x70000011 MIPS_SYMTABNO 2
58 # PIE-NEXT: 0x7000000A MIPS_LOCAL_GOTNO 2
59 # PIE-NEXT: 0x70000013 MIPS_GOTSYM 0x2
60 # PIE-NEXT: 0x00000003 PLTGOT [[GOTADDR]]
61 # PIE-NEXT: 0x70000035 MIPS_RLD_MAP_REL 0x{{[0-9A-F]+}}
62 # PIE-NEXT: 0x00000000 NULL 0x0
65 # NOPIE: DynamicSection [
66 # NOPIE-NEXT: Tag Type Name/Value
67 # NOPIE: 0x00000004 HASH 0x{{[0-9A-F]+}}
68 # NOPIE-NEXT: 0x70000001 MIPS_RLD_VERSION 1
69 # NOPIE-NEXT: 0x70000005 MIPS_FLAGS NOTPOT
70 # NOPIE-NEXT: 0x70000006 MIPS_BASE_ADDRESS 0x10000
71 # NOPIE-NEXT: 0x70000011 MIPS_SYMTABNO 2
72 # NOPIE-NEXT: 0x7000000A MIPS_LOCAL_GOTNO 2
73 # NOPIE-NEXT: 0x70000013 MIPS_GOTSYM 0x2
74 # NOPIE-NEXT: 0x00000003 PLTGOT [[GOTADDR]]
75 # NOPIE-NEXT: 0x70000016 MIPS_RLD_MAP [[RLDMAPADDR]]
76 # NOPIE-NEXT: 0x70000035 MIPS_RLD_MAP_REL 0x{{[0-9A-F]+}}
77 # NOPIE-NEXT: 0x00000000 NULL 0x0
80 # IMAGE_BASE: 0x70000006 MIPS_BASE_ADDRESS 0x123000
84 # DSO-NEXT: Type: SHT_DYNAMIC
89 # DSO-NEXT: Type: SHT_PROGBITS
90 # DSO-NEXT: Flags [ (0x10000003)
92 # DSO-NEXT: SHF_MIPS_GPREL
95 # DSO-NEXT: Address: [[GOTADDR:0x[0-9a-f]+]]
99 # DSO: DynamicSection [
100 # DSO-NEXT: Tag Type Name/Value
101 # DSO-DAG: 0x00000003 PLTGOT [[GOTADDR]]
102 # DSO-DAG: 0x70000001 MIPS_RLD_VERSION 1
103 # DSO-DAG: 0x70000005 MIPS_FLAGS NOTPOT
104 # DSO-DAG: 0x70000006 MIPS_BASE_ADDRESS 0x0
105 # DSO-DAG: 0x7000000A MIPS_LOCAL_GOTNO 2
106 # DSO-DAG: 0x70000011 MIPS_SYMTABNO 3
107 # DSO-DAG: 0x70000013 MIPS_GOTSYM 0x3
109 # DSO-NEXT: DynamicSymbols [