1## A user should be able to specify any arbitrary string table as the section 2## header string table, including the symbol string table. This test covers 3## various cases to do with this. 4 5## Case 1: custom name specified for string table. 6# RUN: yaml2obj --docnum=1 %s -o %t1 -DSHSTRTAB=.strings 7# RUN: llvm-readelf -S -p .strings %t1 | FileCheck %s --check-prefix=CASE1 8 9# CASE1: There are 5 section headers 10# CASE1-EMPTY: 11# CASE1-NEXT: Section Headers: 12# CASE1-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 13# CASE1-NEXT: [ 0] NULL 14# CASE1-NEXT: [ 1] .foo{{ }} 15# CASE1-NEXT: [ 2] .bar{{ }} 16# CASE1-NEXT: [ 3] .strtab{{ }} 17# CASE1-NEXT: [ 4] .strings STRTAB 0000000000000000 [[#%x,]] 00001c 00 0 0 1 18 19# CASE1: String dump of section '.strings': 20# CASE1-NEXT: [ 1] .strings{{$}} 21# CASE1-NEXT: [ a] .bar{{$}} 22# CASE1-NEXT: [ f] .foo{{$}} 23# CASE1-NEXT: [ 14] .strtab{{$}} 24# CASE1-EMPTY: 25 26--- !ELF 27FileHeader: 28 Class: ELFCLASS64 29 Data: ELFDATA2LSB 30 Type: ET_EXEC 31 SectionHeaderStringTable: [[SHSTRTAB=<none>]] 32Sections: 33 - Name: .foo 34 Type: SHT_PROGBITS 35 - Name: [[OTHER=.bar]] 36 Type: SHT_PROGBITS 37 38## Case 2: reuse symbol string table. 39# RUN: yaml2obj --docnum=2 %s -o %t2 -DSHSTRTAB=.strtab 40# RUN: llvm-readelf -S -s -p .strtab %t2 | FileCheck %s --check-prefix=CASE2 41 42# CASE2: There are 5 section headers 43# CASE2-EMPTY: 44# CASE2-NEXT: Section Headers: 45# CASE2-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 46# CASE2-NEXT: [ 0] NULL 47# CASE2-NEXT: [ 1] .foo{{ }} 48# CASE2-NEXT: [ 2] .bar{{ }} 49# CASE2-NEXT: [ 3] .symtab{{ }} 50# CASE2-NEXT: [ 4] .strtab STRTAB 0000000000000000 [[#%x,]] 000023 00 0 0 1 51 52# CASE2: Symbol table '.symtab' contains 3 entries: 53# CASE2-NEXT: Num: {{.*}} Ndx Name 54# CASE2-NEXT: 0: {{.*}} UND {{$}} 55# CASE2-NEXT: 1: {{.*}} baz{{$}} 56# CASE2-NEXT: 2: {{.*}} bob{{$}} 57 58# CASE2: String dump of section '.strtab': 59# CASE2-NEXT: [ 1] baz{{$}} 60# CASE2-NEXT: [ 5] .bar{{$}} 61# CASE2-NEXT: [ a] .foo{{$}} 62# CASE2-NEXT: [ f] bob{{$}} 63# CASE2-NEXT: [ 13] .strtab{{$}} 64# CASE2-NEXT: [ 1b] .symtab{{$}} 65# CASE2-EMPTY: 66 67--- !ELF 68FileHeader: 69 Class: ELFCLASS64 70 Data: ELFDATA2LSB 71 Type: ET_EXEC 72 SectionHeaderStringTable: [[SHSTRTAB]] 73Sections: 74 - Name: .foo 75 Type: SHT_PROGBITS 76 - Name: .bar 77 Type: SHT_PROGBITS 78Symbols: 79 - Name: baz 80 - Name: bob 81 82## Case 3: reuse dynamic string table. 83# RUN: yaml2obj --docnum=3 %s -o %t3 -DSHSTRTAB=.dynstr 84# RUN: llvm-readelf -S --dyn-syms -p .dynstr %t3 | FileCheck %s --check-prefix=CASE3 85 86--- !ELF 87FileHeader: 88 Class: ELFCLASS64 89 Data: ELFDATA2LSB 90 Type: ET_EXEC 91 SectionHeaderStringTable: [[SHSTRTAB]] 92Sections: 93 - Name: .foo 94 Type: SHT_PROGBITS 95 - Name: .bar 96 Type: SHT_PROGBITS 97DynamicSymbols: 98 - Name: baz 99 - Name: bob 100 101# CASE3: There are 6 section headers 102# CASE3-EMPTY: 103# CASE3-NEXT: Section Headers: 104# CASE3-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 105# CASE3-NEXT: [ 0] NULL 106# CASE3-NEXT: [ 1] .foo{{ }} 107# CASE3-NEXT: [ 2] .bar{{ }} 108# CASE3-NEXT: [ 3] .dynsym{{ }} 109# CASE3-NEXT: [ 4] .dynstr STRTAB 0000000000000048 [[#%x,]] 00002b 00 A 0 0 1 110# CASE3-NEXT: [ 5] .strtab{{ }} 111 112# CASE3: Symbol table '.dynsym' contains 3 entries: 113# CASE3-NEXT: Num: {{.*}} Ndx Name 114# CASE3-NEXT: 0: {{.*}} UND {{$}} 115# CASE3-NEXT: 1: {{.*}} baz{{$}} 116# CASE3-NEXT: 2: {{.*}} bob{{$}} 117 118# CASE3: String dump of section '.dynstr': 119# CASE3-NEXT: [ 1] baz{{$}} 120# CASE3-NEXT: [ 5] .dynstr{{$}} 121# CASE3-NEXT: [ d] .bar{{$}} 122# CASE3-NEXT: [ 12] .foo{{$}} 123# CASE3-NEXT: [ 17] .dynsym{{$}} 124# CASE3-NEXT: [ 1f] bob{{$}} 125# CASE3-NEXT: [ 23] .strtab{{$}} 126# CASE3-EMPTY: 127 128## Case 4: shstrtab specified to be otherwise ungenerated non-strtab implicit 129## section. 130# RUN: yaml2obj --docnum=1 %s -o %t4 -DSHSTRTAB=.symtab 131# RUN: llvm-readelf -S -p .symtab %t4 | FileCheck %s --check-prefix=CASE4 132 133# CASE4: There are 5 section headers 134# CASE4-EMPTY: 135# CASE4-NEXT: Section Headers: 136# CASE4-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 137# CASE4-NEXT: [ 0] NULL 138# CASE4-NEXT: [ 1] .foo{{ }} 139# CASE4-NEXT: [ 2] .bar{{ }} 140# CASE4-NEXT: [ 3] .strtab{{ }} 141# CASE4-NEXT: [ 4] .symtab STRTAB 0000000000000000 [[#%x,]] 00001b 00 0 0 1 142 143# CASE4: String dump of section '.symtab': 144# CASE4-NEXT: [ 1] .bar{{$}} 145# CASE4-NEXT: [ 6] .foo{{$}} 146# CASE4-NEXT: [ b] .strtab{{$}} 147# CASE4-NEXT: [ 13] .symtab{{$}} 148 149## Case 5: shstrtab specified to be otherwise ungenerated .dynstr section. In 150## this case, the SHF_ALLOC flag will be set. 151# RUN: yaml2obj --docnum=1 %s -o %t5 -DSHSTRTAB=.dynstr 152# RUN: llvm-readelf -S -p .dynstr %t5 | FileCheck %s --check-prefix=CASE5 153 154# CASE5: There are 5 section headers 155# CASE5-EMPTY: 156# CASE5-NEXT: Section Headers: 157# CASE5-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 158# CASE5-NEXT: [ 0] NULL 159# CASE5-NEXT: [ 1] .foo{{ }} 160# CASE5-NEXT: [ 2] .bar{{ }} 161# CASE5-NEXT: [ 3] .strtab{{ }} 162# CASE5-NEXT: [ 4] .dynstr STRTAB 0000000000000001 [[#%x,]] 00001b 00 A 0 0 1 163 164# CASE5: String dump of section '.dynstr': 165# CASE5-NEXT: [ 1] .dynstr{{$}} 166# CASE5-NEXT: [ 9] .bar{{$}} 167# CASE5-NEXT: [ e] .foo{{$}} 168# CASE5-NEXT: [ 13] .strtab{{$}} 169 170## Case 6: shstrtab specified to be otherwise ungenerated .debug_str section. In 171## this case, the sh_entsize will be set to 1. 172# RUN: yaml2obj --docnum=1 %s -o %t6 -DSHSTRTAB=.debug_str 173# RUN: llvm-readelf -S -p .debug_str %t6 | FileCheck %s --check-prefix=CASE6 174 175# CASE6: There are 5 section headers 176# CASE6-EMPTY: 177# CASE6-NEXT: Section Headers: 178# CASE6-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 179# CASE6-NEXT: [ 0] NULL 180# CASE6-NEXT: [ 1] .foo{{ }} 181# CASE6-NEXT: [ 2] .bar{{ }} 182# CASE6-NEXT: [ 3] .strtab{{ }} 183# CASE6-NEXT: [ 4] .debug_str STRTAB 0000000000000000 [[#%x,]] 00001e 01 0 0 1 184 185# CASE6: String dump of section '.debug_str': 186# CASE6-NEXT: [ 1] .debug_str{{$}} 187# CASE6-NEXT: [ c] .bar{{$}} 188# CASE6-NEXT: [ 11] .foo{{$}} 189# CASE6-NEXT: [ 16] .strtab{{$}} 190 191## Case 7: shstrtab specified to be the .symtab section, when there are symbols. 192## This triggers an error (since the symbols cannot be represented in the 193## section as section names). 194# RUN: not yaml2obj --docnum=2 %s -o %t7 -DSHSTRTAB=.symtab 2>&1 | FileCheck %s --check-prefix=ERR1 195 196# ERR1: error: cannot use '.symtab' as the section header name table when there are symbols 197 198## Case 8: shstrtab specified to be the .dynsym section, when there are dynamic 199## symbols. This triggers an error (since the symbols cannot be represented in 200## the section as section names). 201# RUN: not yaml2obj --docnum=3 %s -o %t8 -DSHSTRTAB=.dynsym 2>&1 | FileCheck %s --check-prefix=ERR2 202 203# ERR2: error: cannot use '.dynsym' as the section header name table when there are dynamic symbols 204 205## Case 9: shstrtab specified to be the .debug_str section, when there are DWARF 206## debug strings. This triggers an error. 207# RUN: not yaml2obj --docnum=4 %s -o %t9 2>&1 | FileCheck %s --check-prefix=ERR3 208 209# ERR3: error: cannot use '.debug_str' as the section header name table when it is needed for DWARF output 210 211--- !ELF 212FileHeader: 213 Class: ELFCLASS64 214 Data: ELFDATA2LSB 215 Type: ET_EXEC 216 SectionHeaderStringTable: .debug_str 217DWARF: 218 debug_str: 219 - a 220 221## Case 10: can explicitly specifiy ".shstrtab" as shstrtab. Output will be the 222## same as if it wasn't sepcified at all. 223# RUN: yaml2obj --docnum=1 %s -o %t10 -DSHSTRTAB=.shstrtab 224# RUN: llvm-readelf -S -p .shstrtab %t10 | FileCheck %s --check-prefix=CASE10 225# RUN: yaml2obj --docnum=1 %s -o %t10.default 226# RUN: cmp %t10 %t10.default 227 228# CASE10: There are 5 section headers 229# CASE10-EMPTY: 230# CASE10-NEXT: Section Headers: 231# CASE10-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 232# CASE10-NEXT: [ 0] NULL 233# CASE10-NEXT: [ 1] .foo{{ }} 234# CASE10-NEXT: [ 2] .bar{{ }} 235# CASE10-NEXT: [ 3] .strtab{{ }} 236# CASE10-NEXT: [ 4] .shstrtab STRTAB 0000000000000000 [[#%x,]] 00001d 00 0 0 1 237 238# CASE10: String dump of section '.shstrtab': 239# CASE10-NEXT: [ 1] .bar{{$}} 240# CASE10-NEXT: [ 6] .foo{{$}} 241# CASE10-NEXT: [ b] .shstrtab{{$}} 242# CASE10-NEXT: [ 15] .strtab{{$}} 243# CASE10-EMPTY: 244 245## Case 11: can specify custom shstrtab properties. 246## FIXME: when the section is listed explicitly, the sh_addralign value is 0 if 247## not overwritten, which is inconsistent with when the section is not 248## specified at all. 249# RUN: yaml2obj --docnum=5 %s -o %t11 -DENTSIZE=2 250# RUN: llvm-readelf -S -p .strings %t11 | FileCheck %s --check-prefix=CASE11 251 252# CASE11: There are 5 section headers 253# CASE11-EMPTY: 254# CASE11-NEXT: Section Headers: 255# CASE11-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 256# CASE11-NEXT: [ 0] NULL 257# CASE11-NEXT: [ 1] .foo{{ }} 258# CASE11-NEXT: [ 2] .strings STRTAB 0000000000000000 [[#%x,]] 00001c 02 0 0 0 259# CASE11-NEXT: [ 3] .bar{{ }} 260# CASE11-NEXT: [ 4] .strtab{{ }} 261 262# CASE11: String dump of section '.strings': 263# CASE11-NEXT: [ 1] .strings{{$}} 264# CASE11-NEXT: [ a] .bar{{$}} 265# CASE11-NEXT: [ f] .foo{{$}} 266# CASE11-NEXT: [ 14] .strtab{{$}} 267# CASE11-EMPTY: 268 269--- !ELF 270FileHeader: 271 Class: ELFCLASS64 272 Data: ELFDATA2LSB 273 Type: ET_EXEC 274 SectionHeaderStringTable: .strings 275Sections: 276 - Name: .foo 277 Type: SHT_PROGBITS 278 - Name: .strings 279 Type: [[TYPE=SHT_STRTAB]] 280 EntSize: [[ENTSIZE=<none>]] 281 Size: [[SIZE=<none>]] 282 Content: [[CONTENT=<none>]] 283 - Name: .bar 284 Type: SHT_PROGBITS 285 286## Case 12: shstrtab does not have SHT_STRTAB type. Default properties will be 287## derived from the specified section type. 288# RUN: yaml2obj --docnum=5 %s -o %t12 -DTYPE=SHT_RELA 289# RUN: llvm-readelf -S %t12 | FileCheck %s --check-prefix=CASE12 290 291# CASE12: There are 5 section headers 292# CASE12-EMPTY: 293# CASE12-NEXT: Section Headers: 294# CASE12-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 295# CASE12-NEXT: [ 0] NULL 296# CASE12-NEXT: [ 1] .foo{{ }} 297# CASE12-NEXT: [ 2] .strings RELA 0000000000000000 [[#%x,]] 00001c 18 0 0 0 298# CASE12-NEXT: [ 3] .bar{{ }} 299# CASE12-NEXT: [ 4] .strtab{{ }} 300 301## Case 13: shstrtab has specified Content. The specified content overrides the 302## implicitly generated content. 303# RUN: yaml2obj --docnum=5 %s -o %t13 -DCONTENT="00616263646566676800696a6b6c006d6e6f70007172737475767700787a7b7c00" 304# RUN: llvm-readelf -S %t13 | FileCheck %s --check-prefix=CASE13 305 306# CASE13: There are 5 section headers 307# CASE13-EMPTY: 308# CASE13-NEXT: Section Headers: 309# CASE13-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 310# CASE13-NEXT: [ 0] NULL 311# CASE13-NEXT: [ 1] mnop{{ }} 312# CASE13-NEXT: [ 2] abcdefgh STRTAB 0000000000000000 [[#%x,]] 000021 00 0 0 0 313# CASE13-NEXT: [ 3] ijkl{{ }} 314# CASE13-NEXT: [ 4] qrstuvw{{ }} 315 316## Case 14: shstrtab has specified Size. The section will be filled with zeros 317## to the requested size. 318# RUN: yaml2obj --docnum=5 %s -o %t14 -DSIZE=32 319# RUN: llvm-readelf -S -p 2 %t14 | FileCheck %s --check-prefix=CASE14 320 321# CASE14: There are 5 section headers 322# CASE14-EMPTY: 323# CASE14-NEXT: Section Headers: 324# CASE14-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 325# CASE14-NEXT: [ 0] NULL 326# CASE14-NEXT: [ 1] PROGBITS 327# CASE14-NEXT: [ 2] STRTAB 0000000000000000 [[#%x,]] 000020 00 0 0 0 328# CASE14-NEXT: [ 3] PROGBITS 329# CASE14-NEXT: [ 4] STRTAB 330 331# CASE14: String dump of section '': 332# CASE14-EMPTY: 333 334## Case 15: custom shstrtab and no section header table. The section header 335## names shouldn't appear anywhere in the output file. 336# RUN: yaml2obj --docnum=6 %s -o %t15 337# RUN: FileCheck %s --input-file=%t15 \ 338# RUN: --implicit-check-not=.strings --implicit-check-not=.foo \ 339# RUN: --implicit-check-not=.bar 340 341--- !ELF 342FileHeader: 343 Class: ELFCLASS64 344 Data: ELFDATA2LSB 345 Type: ET_EXEC 346 SectionHeaderStringTable: .strings 347Sections: 348 - Name: .foo 349 Type: SHT_PROGBITS 350 - Name: .bar 351 Type: SHT_PROGBITS 352 - Type: SectionHeaderTable 353 NoHeaders: true 354 355## Case 16: custom shstrtab can be reordered in the section header table. 356# RUN: yaml2obj --docnum=7 %s -o %t16 357# RUN: llvm-readelf -S %t16 | FileCheck %s --check-prefix=CASE16 358 359# CASE16: There are 5 section headers 360# CASE16-EMPTY: 361# CASE16-NEXT: Section Headers: 362# CASE16-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 363# CASE16-NEXT: [ 0] NULL 364# CASE16-NEXT: [ 1] .foo{{ }} 365# CASE16-NEXT: [ 2] .strings STRTAB 0000000000000000 [[#%x,]] 00001c 00 0 0 1 366# CASE16-NEXT: [ 3] .bar{{ }} 367# CASE16-NEXT: [ 4] .strtab{{ }} 368 369--- !ELF 370FileHeader: 371 Class: ELFCLASS64 372 Data: ELFDATA2LSB 373 Type: ET_EXEC 374 SectionHeaderStringTable: .strings 375Sections: 376 - Name: .foo 377 Type: SHT_PROGBITS 378 - Name: .bar 379 Type: SHT_PROGBITS 380 - Type: SectionHeaderTable 381 Sections: 382 - Name: .foo 383 - Name: .strings 384 - Name: .bar 385 - Name: .strtab 386 387## Case 17: custom shstrtab section header can be excluded. 388# RUN: yaml2obj --docnum=8 %s -o %t17 389# RUN: llvm-readelf -h -S %t17 | FileCheck %s --check-prefix=CASE17 390 391# CASE17: Section header string table index: 0 392# CASE17: There are 4 section headers 393# CASE17-EMPTY: 394# CASE17-NEXT: Section Headers: 395# CASE17-NEXT: [Nr] Name Type 396# CASE17-NEXT: [ 0] <no-strings> NULL 397# CASE17-NEXT: [ 1] <no-strings> PROGBITS 398# CASE17-NEXT: [ 2] <no-strings> PROGBITS 399# CASE17-NEXT: [ 3] <no-strings> STRTAB 400 401--- !ELF 402FileHeader: 403 Class: ELFCLASS64 404 Data: ELFDATA2LSB 405 Type: ET_EXEC 406 SectionHeaderStringTable: .strings 407Sections: 408 - Name: .foo 409 Type: SHT_PROGBITS 410 - Name: .bar 411 Type: SHT_PROGBITS 412 - Type: SectionHeaderTable 413 Sections: 414 - Name: .foo 415 - Name: .bar 416 - Name: .strtab 417 Excluded: 418 - Name: .strings 419 420## Case 18: section name for excluded section does not appear in custom 421## shstrtab. 422# RUN: yaml2obj --docnum=9 %s -o %t18 423# RUN: llvm-readelf -S -p .strings %t18 | FileCheck %s --check-prefix=CASE18 424 425# CASE18: There are 4 section headers 426# CASE18-EMPTY: 427# CASE18-NEXT: Section Headers: 428# CASE18-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 429# CASE18-NEXT: [ 0] NULL 430# CASE18-NEXT: [ 1] .foo{{ }} 431# CASE18-NEXT: [ 2] .strings STRTAB 0000000000000000 [[#%x,]] 000017 00 0 0 1 432# CASE18-NEXT: [ 3] .strtab{{ }} 433 434# CASE18: String dump of section '.strings': 435# CASE18-NEXT: [ 1] .strings 436# CASE18-NEXT: [ a] .foo 437# CASE18-NEXT: [ f] .strtab 438# CASE18-EMPTY: 439 440--- !ELF 441FileHeader: 442 Class: ELFCLASS64 443 Data: ELFDATA2LSB 444 Type: ET_EXEC 445 SectionHeaderStringTable: .strings 446Sections: 447 - Name: .foo 448 Type: SHT_PROGBITS 449 - Name: .bar 450 Type: SHT_PROGBITS 451 - Type: SectionHeaderTable 452 Sections: 453 - Name: .foo 454 - Name: .strings 455 - Name: .strtab 456 Excluded: 457 - Name: .bar 458 459## Case 19: custom shstrtab can have a uniqued name. 460# RUN: yaml2obj --docnum=1 %s -o %t19 '-DSHSTRTAB=.strings (1)' '-DOTHER=.strings (0)' 461# RUN: llvm-readelf -S -p 4 %t19 | FileCheck %s --check-prefix=CASE19 462 463# CASE19: There are 5 section headers 464# CASE19-EMPTY: 465# CASE19-NEXT: Section Headers: 466# CASE19-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 467# CASE19-NEXT: [ 0] NULL 468# CASE19-NEXT: [ 1] .foo{{ }} 469# CASE19-NEXT: [ 2] .strings PROGBITS 470# CASE19-NEXT: [ 3] .strtab{{ }} 471# CASE19-NEXT: [ 4] .strings STRTAB 0000000000000000 [[#%x,]] 000017 00 0 0 1 472 473# CASE19: String dump of section '.strings': 474# CASE19-NEXT: [ 1] .strings{{$}} 475# CASE19-NEXT: [ a] .foo{{$}} 476# CASE19-NEXT: [ f] .strtab{{$}} 477# CASE19-EMPTY: 478 479## Case 20: custom shstrtab named ".strtab" with uniquifying ID. 480# RUN: yaml2obj --docnum=2 %s -o %t20 '-DSHSTRTAB=.strtab (1)' 481# RUN: llvm-readelf -S -s -p 4 -p 5 %t20 | FileCheck %s --check-prefix=CASE20 482 483# CASE20: There are 6 section headers 484# CASE20-EMPTY: 485# CASE20-NEXT: Section Headers: 486# CASE20-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 487# CASE20-NEXT: [ 0] NULL 488# CASE20-NEXT: [ 1] .foo{{ }} 489# CASE20-NEXT: [ 2] .bar{{ }} 490# CASE20-NEXT: [ 3] .symtab{{ }} 491# CASE20-NEXT: [ 4] .strtab STRTAB [[#%x,]] [[#%x,]] 000009 00 0 0 1 492# CASE20-NEXT: [ 5] .strtab STRTAB 0000000000000000 [[#%x,]] 00001b 00 0 0 1 493 494# CASE20: Symbol table '.symtab' contains 3 entries: 495# CASE20-NEXT: Num: {{.*}} Ndx Name 496# CASE20-NEXT: 0: {{.*}} UND {{$}} 497# CASE20-NEXT: 1: {{.*}} baz{{$}} 498# CASE20-NEXT: 2: {{.*}} bob{{$}} 499 500# CASE20: String dump of section '.strtab': 501# CASE20-NEXT: [ 1] baz 502# CASE20-NEXT: [ 5] bob 503# CASE20-EMPTY: 504 505# CASE20: String dump of section '.strtab': 506# CASE20-NEXT: [ 1] .bar{{$}} 507# CASE20-NEXT: [ 6] .foo{{$}} 508# CASE20-NEXT: [ b] .strtab{{$}} 509# CASE20-NEXT: [ 13] .symtab{{$}} 510# CASE20-EMPTY: 511 512## Case 21: custom shstrtab named ".dynstr" with uniquifying ID. 513# RUN: yaml2obj --docnum=3 %s -o %t21 '-DSHSTRTAB=.dynstr (1)' 514# RUN: llvm-readelf -S --dyn-syms -p 4 -p 6 %t21 | FileCheck %s --check-prefix=CASE21 515 516# CASE21: There are 7 section headers 517# CASE21-EMPTY: 518# CASE21-NEXT: Section Headers: 519# CASE21-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al 520# CASE21-NEXT: [ 0] NULL 521# CASE21-NEXT: [ 1] .foo{{ }} 522# CASE21-NEXT: [ 2] .bar{{ }} 523# CASE21-NEXT: [ 3] .dynsym{{ }} 524# CASE21-NEXT: [ 4] .dynstr STRTAB [[#%x,]] [[#%x,]] 000009 00 A 0 0 1 525# CASE21-NEXT: [ 5] .strtab{{ }} 526# CASE21-NEXT: [ 6] .dynstr STRTAB 0000000000000000 [[#%x,]] 000023 00 0 0 1 527 528# CASE21: Symbol table '.dynsym' contains 3 entries: 529# CASE21-NEXT: Num: {{.*}} Ndx Name 530# CASE21-NEXT: 0: {{.*}} UND {{$}} 531# CASE21-NEXT: 1: {{.*}} baz{{$}} 532# CASE21-NEXT: 2: {{.*}} bob{{$}} 533 534# CASE21: String dump of section '.dynstr': 535# CASE21-NEXT: [ 1] baz 536# CASE21-NEXT: [ 5] bob 537# CASE21-EMPTY: 538 539# CASE21: String dump of section '.dynstr': 540# CASE21-NEXT: [ 1] .dynstr{{$}} 541# CASE21-NEXT: [ 9] .bar{{$}} 542# CASE21-NEXT: [ e] .foo{{$}} 543# CASE21-NEXT: [ 13] .dynsym{{$}} 544# CASE21-NEXT: [ 1b] .strtab{{$}} 545# CASE21-EMPTY: 546