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