472 lines · plain
1## Test handling of a dynamic section size which is not a multiple of its entry size.2## Test the full output to demonstrate how we print the warnings.3 4# RUN: yaml2obj %s --docnum=1 -o %t.bad-size5# RUN: llvm-readobj --all %t.bad-size 2>&1 \6# RUN: | FileCheck %s -DFILE=%t.bad-size --implicit-check-not=warning: --check-prefix WARN7# RUN: llvm-readelf --all %t.bad-size 2>&1 \8# RUN: | FileCheck %s -DFILE=%t.bad-size --implicit-check-not=warning: --check-prefix WARN-GNU9 10# WARN: warning: '[[FILE]]': invalid PT_DYNAMIC size (0x4){{$}}11# WARN: warning: '[[FILE]]': SHT_DYNAMIC section with index 1 has invalid size (0x4){{$}}12# WARN: warning: '[[FILE]]': no valid dynamic table was found13# WARN-EMPTY:14# WARN: File:15# WARN: ProgramHeaders [16# WARN: Symbols [17# WARN: ]18 19# WARN-GNU: warning: '[[FILE]]': invalid PT_DYNAMIC size (0x4){{$}}20# WARN-GNU: warning: '[[FILE]]': SHT_DYNAMIC section with index 1 has invalid size (0x4){{$}}21# WARN-GNU: warning: '[[FILE]]': no valid dynamic table was found22# WARN-GNU-NEXT: ELF Header:23# WARN-GNU: Symbol table '.symtab' contains 1 entries:24# WARN-GNU: 0:25 26--- !ELF27FileHeader:28 Class: ELFCLASS6429 Data: ELFDATA2LSB30 Type: ET_EXEC31Sections:32 - Name: .dynamic33 Type: SHT_DYNAMIC34 Address: 0x100035 Content: "01234567"36Symbols: []37ProgramHeaders:38 - Type: PT_LOAD39 VAddr: 0x100040 FirstSec: .dynamic41 LastSec: .dynamic42 - Type: PT_DYNAMIC43 VAddr: 0x100044 FirstSec: .dynamic45 LastSec: .dynamic46 47## Test handling of a .dynamic section with an invalid entsize (i.e. not 2 * sizeof(Elf_Dyn)).48# RUN: yaml2obj %s --docnum=2 -o %t.bad-entsize49# RUN: llvm-readobj --dynamic-table %t.bad-entsize | FileCheck %s --check-prefix BAD-ENTSIZE-LLVM50# RUN: llvm-readelf --dynamic-table %t.bad-entsize | FileCheck %s --check-prefix BAD-ENTSIZE-GNU51 52# BAD-ENTSIZE-LLVM: DynamicSection [ (2 entries)53# BAD-ENTSIZE-LLVM-NEXT: Tag Type Name/Value54# BAD-ENTSIZE-LLVM-NEXT: 0x0000000000000015 DEBUG 0x055# BAD-ENTSIZE-LLVM-NEXT: 0x0000000000000000 NULL 0x056# BAD-ENTSIZE-LLVM-NEXT: ]57 58# BAD-ENTSIZE-GNU: Dynamic section at offset 0x{{.*}} contains 2 entries:59# BAD-ENTSIZE-GNU-NEXT: Tag Type Name/Value60# BAD-ENTSIZE-GNU-NEXT: 0x0000000000000015 (DEBUG) 0x061# BAD-ENTSIZE-GNU-NEXT: 0x0000000000000000 (NULL) 0x062 63--- !ELF64FileHeader:65 Class: ELFCLASS6466 Data: ELFDATA2LSB67 Type: ET_EXEC68Sections:69 - Name: .dynamic70 Type: SHT_DYNAMIC71 Address: 0x100072 EntSize: 0x273 Entries:74 - Tag: DT_DEBUG75 Value: 076 - Tag: DT_NULL77 Value: 078Symbols: []79ProgramHeaders:80 - Type: PT_LOAD81 VAddr: 0x100082 FirstSec: .dynamic83 LastSec: .dynamic84 - Type: PT_DYNAMIC85 VAddr: 0x100086 FirstSec: .dynamic87 LastSec: .dynamic88 89## Test handling of string references pointing past the end of the dynamic string table.90# RUN: yaml2obj %s --docnum=3 -o %t.bad-string91# RUN: llvm-readobj --dynamic-table %t.bad-string 2>&1 | \92# RUN: FileCheck %s --implicit-check-not=warning: --check-prefix BAD-STRING-LLVM -DFILE=%t.bad-string93# RUN: llvm-readelf --dynamic-table %t.bad-string 2>&1 | \94# RUN: FileCheck %s --implicit-check-not=warning: --check-prefix BAD-STRING-GNU -DFILE=%t.bad-string95 96# BAD-STRING-LLVM: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb6: it goes past the end of the table (0xb1)97# BAD-STRING-LLVM: LoadName: <?>98# BAD-STRING-LLVM: DynamicSection [ (10 entries)99# BAD-STRING-LLVM-NEXT: Tag Type Name/Value100# BAD-STRING-LLVM-NEXT: 0x0000000000000005 STRTAB 0x1000101# BAD-STRING-LLVM-NEXT: 0x000000000000000A STRSZ 1 (bytes)102# BAD-STRING-LLVM-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb2: it goes past the end of the table (0xb1)103# BAD-STRING-LLVM-NEXT: 0x0000000000000001 NEEDED Shared library: [<?>]104# BAD-STRING-LLVM-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb3: it goes past the end of the table (0xb1)105# BAD-STRING-LLVM-NEXT: 0x000000007FFFFFFF FILTER Filter library: [<?>]106# BAD-STRING-LLVM-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb4: it goes past the end of the table (0xb1)107# BAD-STRING-LLVM-NEXT: 0x000000007FFFFFFD AUXILIARY Auxiliary library: [<?>]108# BAD-STRING-LLVM-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb5: it goes past the end of the table (0xb1)109# BAD-STRING-LLVM-NEXT: 0x000000007FFFFFFE USED Not needed object: [<?>]110## Note: there is no "string table at offset 0xb0..." warning here, because it was printed earlier.111# BAD-STRING-LLVM-NEXT: 0x000000000000000E SONAME Library soname: [<?>]112# BAD-STRING-LLVM-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb7: it goes past the end of the table (0xb1)113# BAD-STRING-LLVM-NEXT: 0x000000000000000F RPATH Library rpath: [<?>]114# BAD-STRING-LLVM-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb8: it goes past the end of the table (0xb1)115# BAD-STRING-LLVM-NEXT: 0x000000000000001D RUNPATH Library runpath: [<?>]116# BAD-STRING-LLVM-NEXT: 0x0000000000000000 NULL 0x0117# BAD-STRING-LLVM-NEXT: ]118 119# BAD-STRING-GNU: Dynamic section at offset 0xb1 contains 10 entries:120# BAD-STRING-GNU-NEXT: Tag Type Name/Value121# BAD-STRING-GNU-NEXT: 0x0000000000000005 (STRTAB) 0x1000122# BAD-STRING-GNU-NEXT: 0x000000000000000a (STRSZ) 1 (bytes)123# BAD-STRING-GNU-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb2: it goes past the end of the table (0xb1)124# BAD-STRING-GNU-NEXT: 0x0000000000000001 (NEEDED) Shared library: [<?>]125# BAD-STRING-GNU-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb3: it goes past the end of the table (0xb1)126# BAD-STRING-GNU-NEXT: 0x000000007fffffff (FILTER) Filter library: [<?>]127# BAD-STRING-GNU-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb4: it goes past the end of the table (0xb1)128# BAD-STRING-GNU-NEXT: 0x000000007ffffffd (AUXILIARY) Auxiliary library: [<?>]129# BAD-STRING-GNU-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb5: it goes past the end of the table (0xb1)130# BAD-STRING-GNU-NEXT: 0x000000007ffffffe (USED) Not needed object: [<?>]131# BAD-STRING-GNU-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb6: it goes past the end of the table (0xb1)132# BAD-STRING-GNU-NEXT: 0x000000000000000e (SONAME) Library soname: [<?>]133# BAD-STRING-GNU-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb7: it goes past the end of the table (0xb1)134# BAD-STRING-GNU-NEXT: 0x000000000000000f (RPATH) Library rpath: [<?>]135# BAD-STRING-GNU-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb8: it goes past the end of the table (0xb1)136# BAD-STRING-GNU-NEXT: 0x000000000000001d (RUNPATH) Library runpath: [<?>]137# BAD-STRING-GNU-NEXT: 0x0000000000000000 (NULL) 0x0138 139--- !ELF140FileHeader:141 Class: ELFCLASS64142 Data: ELFDATA2LSB143 Type: ET_EXEC144Sections:145 - Name: .dynstr146 Type: SHT_STRTAB147 Address: 0x1000148 - Name: .dynamic149 Type: SHT_DYNAMIC150 Address: 0x1010151 Entries:152 - Tag: DT_STRTAB153 Value: 0x1000154 - Tag: DT_STRSZ155 Value: 1156 - Tag: DT_NEEDED157 Value: 2158 - Tag: DT_FILTER159 Value: 3160 - Tag: DT_AUXILIARY161 Value: 4162 - Tag: DT_USED163 Value: 5164 - Tag: DT_SONAME165 Value: 6166 - Tag: DT_RPATH167 Value: 7168 - Tag: DT_RUNPATH169 Value: 8170 - Tag: DT_NULL171 Value: 0172Symbols: []173ProgramHeaders:174 - Type: PT_LOAD175 VAddr: 0x1000176 FirstSec: .dynstr177 LastSec: .dynamic178 - Type: PT_DYNAMIC179 VAddr: 0x1010180 FirstSec: .dynamic181 LastSec: .dynamic182 183## Test handling of DT_STRTAB pointing outside the file's address space.184# RUN: yaml2obj %s --docnum=4 -o %t.bad-strtab185 186# RUN: llvm-readobj --dynamic-table %t.bad-strtab 2>&1 >/dev/null | \187# RUN: FileCheck -DFILE=%t.bad-strtab %s --implicit-check-not=warning: --check-prefix=BAD-STRTAB-ERR188# RUN: llvm-readelf --dynamic-table %t.bad-strtab 2>&1 >/dev/null | \189# RUN: FileCheck -DFILE=%t.bad-strtab %s --implicit-check-not=warning: --check-prefix=BAD-STRTAB-ERR190# BAD-STRTAB-ERR: warning: '[[FILE]]': unable to parse DT_STRTAB: virtual address is not in any segment: 0x2000000191# BAD-STRTAB-ERR: warning: '[[FILE]]': string table was not found192# BAD-STRTAB-ERR-NOT:{{.}}193 194# RUN: llvm-readobj --dynamic-table --needed-libs %t.bad-strtab 2>&1 | \195# RUN: FileCheck -DFILE=%t.bad-strtab %s --check-prefixes=BAD-STRTAB-ERR2,BAD-STRTAB,BAD-STRTAB-LLVM196# RUN: llvm-readelf --dynamic-table --needed-libs %t.bad-strtab 2>&1 | \197# RUN: FileCheck -DFILE=%t.bad-strtab %s --check-prefixes=BAD-STRTAB-ERR2,BAD-STRTAB,BAD-STRTAB-GNU198 199# BAD-STRTAB-ERR2: warning: '[[FILE]]': unable to parse DT_STRTAB: virtual address is not in any segment: 0x2000000200# BAD-STRTAB-LLVM: LoadName: <Not found>201# BAD-STRTAB: warning: '[[FILE]]': string table was not found202# BAD-STRTAB-LLVM-NEXT: 0x0000000000000001 NEEDED Shared library: [<?>]203# BAD-STRTAB-GNU-NEXT: 0x0000000000000001 (NEEDED) Shared library: [<?>]204# BAD-STRTAB: NeededLibraries [205# BAD-STRTAB: <?>206# BAD-STRTAB: ]207 208--- !ELF209FileHeader:210 Class: ELFCLASS64211 Data: ELFDATA2LSB212 Type: ET_EXEC213Sections:214 - Name: .dynamic215 Type: SHT_DYNAMIC216 Address: 0x1000217 Entries:218## Two DT_STRTAB entries are needed to check that we don't report it twice.219 - Tag: DT_STRTAB220 Value: 0x2000000221 - Tag: DT_STRTAB222 Value: 0x2000000223 - Tag: DT_STRSZ224 Value: 10225 - Tag: DT_NEEDED226 Value: 1227 - Tag: DT_NULL228 Value: 0x0229Symbols: []230ProgramHeaders:231 - Type: PT_LOAD232 VAddr: 0x1000233 FirstSec: .dynamic234 LastSec: .dynamic235 - Type: PT_DYNAMIC236 VAddr: 0x1000237 FirstSec: .dynamic238 LastSec: .dynamic239 240## Test handling of other d_ptr tags pointing outside the file's address space.241# RUN: yaml2obj %s --docnum=5 -o %t.bad-rela242# RUN: llvm-readobj --dynamic-table %t.bad-rela 2>&1 | FileCheck -DFILE=%t.bad-rela %s --check-prefixes=CHECK,BAD-RELA243# RUN: llvm-readelf --dynamic-table %t.bad-rela 2>&1 | FileCheck -DFILE=%t.bad-rela %s --check-prefixes=CHECK,BAD-RELA-GNU244 245# CHECK: warning: '[[FILE]]': unable to parse DT_RELA: virtual address is not in any segment: 0x1000000246 247# BAD-RELA: DynamicSection [ (2 entries)248# BAD-RELA-NEXT: Tag Type Name/Value249# BAD-RELA-NEXT: 0x0000000000000007 RELA 0x1000000250# BAD-RELA-NEXT: 0x0000000000000000 NULL 0x0251# BAD-RELA-NEXT: ]252# BAD-RELA-GNU: Dynamic section at offset 0xb0 contains 2 entries:253# BAD-RELA-GNU-NEXT: Tag Type Name/Value254# BAD-RELA-GNU-NEXT: 0x0000000000000007 (RELA) 0x1000000255# BAD-RELA-GNU-NEXT: 0x0000000000000000 (NULL) 0x0256 257--- !ELF258FileHeader:259 Class: ELFCLASS64260 Data: ELFDATA2LSB261 Type: ET_EXEC262Sections:263 - Name: .dynamic264 Type: SHT_DYNAMIC265 Address: 0x1000266 Entries:267 - Tag: DT_RELA268 Value: 0x1000000269 - Tag: DT_NULL270 Value: 0x0271Symbols: []272ProgramHeaders:273 - Type: PT_LOAD274 VAddr: 0x1000275 FirstSec: .dynamic276 LastSec: .dynamic277 - Type: PT_DYNAMIC278 VAddr: 0x1000279 FirstSec: .dynamic280 LastSec: .dynamic281 282## Check how we handle cases when the dynamic string table is not null-terminated.283 284## Case A: the value of the DT_STRSZ tag is equal to the size of285## the not null-terminated dynamic string table.286# RUN: yaml2obj %s -DSTRSZ=7 --docnum=6 -o %t6287# RUN: llvm-readobj --dynamic-table %t6 2>&1 | \288# RUN: FileCheck %s -DFILE=%t6 --implicit-check-not=warning: \289# RUN: --check-prefixes=NOT-TERMINATED,NOT-TERMINATED-LLVM,NOT-TERMINATED-GREQ290# RUN: llvm-readelf --dynamic-table %t6 2>&1 | \291# RUN: FileCheck %s -DFILE=%t6 --implicit-check-not=warning: \292# RUN: --check-prefixes=NOT-TERMINATED,NOT-TERMINATED-GNU,NOT-TERMINATED-GREQ293 294## Case B: the value of the DT_STRSZ tag is less than the size of295## the not null-terminated dynamic string table.296# RUN: yaml2obj %s -DSTRSZ=6 --docnum=6 -o %t7297# RUN: llvm-readobj --dynamic-table %t7 2>&1 | \298# RUN: FileCheck %s -DFILE=%t7 --implicit-check-not=warning: \299# RUN: --check-prefixes=NOT-TERMINATED,NOT-TERMINATED-LLVM,NOT-TERMINATED-LESS300# RUN: llvm-readelf --dynamic-table %t7 2>&1 | \301# RUN: FileCheck %s -DFILE=%t7 --implicit-check-not=warning: \302# RUN: --check-prefixes=NOT-TERMINATED,NOT-TERMINATED-GNU,NOT-TERMINATED-LESS303 304## Case C: the value of the DT_STRSZ tag is one byte larger than the size of305## the not null-terminated dynamic string table.306# RUN: yaml2obj %s -DSTRSZ=8 --docnum=6 -o %t8307# RUN: llvm-readobj --dynamic-table %t8 2>&1 | \308# RUN: FileCheck %s -DFILE=%t8 --implicit-check-not=warning: \309# RUN: --check-prefixes=NOT-TERMINATED,NOT-TERMINATED-LLVM,NOT-TERMINATED-GREQ310# RUN: llvm-readelf --dynamic-table %t8 2>&1 | \311# RUN: FileCheck %s -DFILE=%t8 --implicit-check-not=warning: \312# RUN: --check-prefixes=NOT-TERMINATED,NOT-TERMINATED-GNU,NOT-TERMINATED-GREQ313 314# NOT-TERMINATED-LLVM: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb4: the string table is not null-terminated315# NOT-TERMINATED: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb0: the string table is not null-terminated316# NOT-TERMINATED-NEXT: {{[(]?}}NEEDED{{[)]?}} Shared library: [<?>]317# NOT-TERMINATED-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb1: the string table is not null-terminated318# NOT-TERMINATED-NEXT: {{[(]?}}FILTER{{[)]?}} Filter library: [<?>]319# NOT-TERMINATED-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb2: the string table is not null-terminated320# NOT-TERMINATED-NEXT: {{[(]?}}AUXILIARY{{[)]?}} Auxiliary library: [<?>]321# NOT-TERMINATED-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb3: the string table is not null-terminated322# NOT-TERMINATED-NEXT: {{[(]?}}USED{{[)]?}} Not needed object: [<?>]323# NOT-TERMINATED-GNU-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb4: the string table is not null-terminated324# NOT-TERMINATED-NEXT: {{[(]?}}SONAME{{[)]?}} Library soname: [<?>]325# NOT-TERMINATED-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb5: the string table is not null-terminated326# NOT-TERMINATED-NEXT: {{[(]?}}RPATH{{[)]?}} Library rpath: [<?>]327# NOT-TERMINATED-GREQ-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb6: the string table is not null-terminated328# NOT-TERMINATED-LESS-NEXT: warning: '[[FILE]]': string table at offset 0xb0: unable to read the string at 0xb6: it goes past the end of the table (0xb6)329# NOT-TERMINATED-NEXT: {{[(]?}}RUNPATH{{[)]?}} Library runpath: [<?>]330# NOT-TERMINATED-NEXT: {{[(]?}}NULL{{[)]?}} 0x0331 332--- !ELF333FileHeader:334 Class: ELFCLASS64335 Data: ELFDATA2LSB336 Type: ET_EXEC337Sections:338 - Name: .dynstr339 Type: SHT_STRTAB340 Address: 0x1000341 Content: '746573742e736f' ## "test.so", not null terminated.342 - Type: Fill343 Pattern: "61626300" ## 'a', 'b', 'c', '\0'.344 Size: "4"345 - Name: .dynamic346 Type: SHT_DYNAMIC347 Address: 0x1100348 Entries:349 - Tag: DT_STRTAB350 Value: 0x1000351 - Tag: DT_STRSZ352 Value: [[STRSZ]]353 - Tag: DT_NEEDED354 Value: 0355 - Tag: DT_FILTER356 Value: 1357 - Tag: DT_AUXILIARY358 Value: 2359 - Tag: DT_USED360 Value: 3361 - Tag: DT_SONAME362 Value: 4363 - Tag: DT_RPATH364 Value: 5365 - Tag: DT_RUNPATH366 Value: 6367 - Tag: DT_NULL368 Value: 0369ProgramHeaders:370 - Type: PT_LOAD371 VAddr: 0x1000372 FirstSec: .dynstr373 LastSec: .dynamic374 - Type: PT_DYNAMIC375 VAddr: 0x1100376 FirstSec: .dynamic377 LastSec: .dynamic378 379## Check that we emit an appropriate warning when the dynamic string table ends past the end of the file.380 381## Case A: the value of DT_STRSZ tag is set so that the string table ends382## right before the EOF. No warning should be emitted.383# RUN: yaml2obj %s -DSTRSZ=0x210 --docnum=6 -o %t9.1384# RUN: llvm-readobj --dynamic-table %t9.1 | \385# RUN: FileCheck %s --implicit-check-not=warning: --check-prefix=BEFORE-THE-EOF386# RUN: llvm-readelf --dynamic-table %t9.1 | \387# RUN: FileCheck %s --implicit-check-not=warning: --check-prefix=BEFORE-THE-EOF388 389## Note: The code reads the data in [DT_STRTAB, DT_STRTAB + DT_STRSZ] as the string table390## as normal. Since the file ends with a zero byte, strings are dumped, but if it didn't,391## we'd get <?> printed instead. The important bit is that we don't get the past the end warning.392 393# BEFORE-THE-EOF: {{[(]?}}NEEDED{{[)]?}} Shared library: [test.soabc]394# BEFORE-THE-EOF-NEXT: {{[(]?}}FILTER{{[)]?}} Filter library: [est.soabc]395# BEFORE-THE-EOF-NEXT: {{[(]?}}AUXILIARY{{[)]?}} Auxiliary library: [st.soabc]396# BEFORE-THE-EOF-NEXT: {{[(]?}}USED{{[)]?}} Not needed object: [t.soabc]397# BEFORE-THE-EOF-NEXT: {{[(]?}}SONAME{{[)]?}} Library soname: [.soabc]398# BEFORE-THE-EOF-NEXT: {{[(]?}}RPATH{{[)]?}} Library rpath: [soabc]399# BEFORE-THE-EOF-NEXT: {{[(]?}}RUNPATH{{[)]?}} Library runpath: [oabc]400# BEFORE-THE-EOF-NEXT: {{[(]?}}NULL{{[)]?}} 0x0401 402## Case B: the value of DT_STRSZ tag is set so that the string table goes 1 byte past the EOF.403# RUN: yaml2obj %s -DSTRSZ=0x211 --docnum=6 -o %t9.2404# RUN: llvm-readobj --dynamic-table %t9.2 2>&1 | FileCheck %s -DFILE=%t9.2 --check-prefix=PAST-THE-EOF405# RUN: llvm-readelf --dynamic-table %t9.2 2>&1 | FileCheck %s -DFILE=%t9.2 --check-prefix=PAST-THE-EOF406 407# PAST-THE-EOF: warning: '[[FILE]]': the dynamic string table at 0xb0 goes past the end of the file (0x2c0) with DT_STRSZ = 0x211408# PAST-THE-EOF: warning: '[[FILE]]': string table was not found409# PAST-THE-EOF: {{[(]?}}NEEDED{{[)]?}} Shared library: [<?>]410# PAST-THE-EOF-NEXT: {{[(]?}}FILTER{{[)]?}} Filter library: [<?>]411# PAST-THE-EOF-NEXT: {{[(]?}}AUXILIARY{{[)]?}} Auxiliary library: [<?>]412# PAST-THE-EOF-NEXT: {{[(]?}}USED{{[)]?}} Not needed object: [<?>]413# PAST-THE-EOF-NEXT: {{[(]?}}SONAME{{[)]?}} Library soname: [<?>]414# PAST-THE-EOF-NEXT: {{[(]?}}RPATH{{[)]?}} Library rpath: [<?>]415# PAST-THE-EOF-NEXT: {{[(]?}}RUNPATH{{[)]?}} Library runpath: [<?>]416# PAST-THE-EOF-NEXT: {{[(]?}}NULL{{[)]?}} 0x0417 418## Check that we report a warning when we try to map an address, but loadable419## segments appear unsorted by the p_vaddr member. In this case we are still420## able to map an address.421 422# RUN: yaml2obj %s --docnum=7 -o %t10423# RUN: llvm-readobj --dynamic-table %t10 2>&1 | \424# RUN: FileCheck %s -DFILE=%t10 --implicit-check-not=warning: --check-prefixes=OUT-OF-ORDER,OUT-OF-ORDER-LLVM425# RUN: llvm-readelf --dynamic-table %t10 2>&1 | \426# RUN: FileCheck %s -DFILE=%t10 --implicit-check-not=warning: --check-prefixes=OUT-OF-ORDER,OUT-OF-ORDER-GNU427 428# OUT-OF-ORDER: warning: '[[FILE]]': loadable segments are unsorted by virtual address429 430# OUT-OF-ORDER-LLVM: DynamicSection [ (2 entries)431# OUT-OF-ORDER-LLVM-NEXT: Tag Type Name/Value432# OUT-OF-ORDER-LLVM-NEXT: 0x0000000000000005 STRTAB 0x1000433# OUT-OF-ORDER-LLVM-NEXT: 0x0000000000000000 NULL 0x0434# OUT-OF-ORDER-LLVM-NEXT: ]435 436# OUT-OF-ORDER-GNU: Dynamic section at offset 0xe9 contains 2 entries:437# OUT-OF-ORDER-GNU-NEXT: Tag Type Name/Value438# OUT-OF-ORDER-GNU-NEXT: 0x0000000000000005 (STRTAB) 0x1000439# OUT-OF-ORDER-GNU-NEXT: 0x0000000000000000 (NULL) 0x0440 441--- !ELF442FileHeader:443 Class: ELFCLASS64444 Data: ELFDATA2LSB445 Type: ET_EXEC446Sections:447 - Name: .dynstr448 Type: SHT_STRTAB449 Address: 0x1000450 - Name: .dynamic451 Type: SHT_DYNAMIC452 Address: 0x1010453 Entries:454 - Tag: DT_STRTAB455 Value: 0x1000456 - Tag: DT_NULL457 Value: 0458Symbols: []459ProgramHeaders:460 - Type: PT_LOAD461 VAddr: 0x1010462 FirstSec: .dynamic463 LastSec: .dynamic464 - Type: PT_LOAD465 VAddr: 0x1000466 FirstSec: .dynstr467 LastSec: .dynstr468 - Type: PT_DYNAMIC469 VAddr: 0x1010470 FirstSec: .dynamic471 LastSec: .dynamic472