[PATCH] D141848: [Test] Fix YAML mapping keys duplication. NFC.

Anton Sidorenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 04:16:03 PST 2023


asi-sc added a comment.

@jhenderson , thanks for your investigation and really detailed explanation!

> There are a few ways of doing this, but I suggest the following snippet to replace the existing .symtab.dyn section:
>
>   - Name:            .symtab.dyn
>     Type:            SHT_SYMTAB
>     Link:            .strab.dyn
>     Flags:           [ SHF_ALLOC ]
>   - Name:            .strtab.dyn
>     Type:            SHT_STRTAB
>     Flags:           [ SHF_ALLOC ]
>
> If you make that change to the YAML, you'll also need to add .strtab.dyn to the CHECK: list of sections that are preserved below the YAML, and increase the SectionHeaderCount check from 8 to 9.
>
> Hopefully that all makes sense. You're welcome to spin this into a separate patch, if you want, to avoid confusing the other test changes, since this is a non-trivial change in the test.

I tried the suggested change and it seems we faced with one more issue: `llvm-objcopy: error: Symbol table has link index of 4 which is not a string table`
There is even one more test that suffers from it - https://github.com/llvm/llvm-project/blob/main/llvm/test/tools/llvm-objcopy/ELF/only-keep-debug.test#L214 . So, I can repeat the temporary fix from this test and use SHT_STRTAB type for .symtab.dyn section. But maybe you could have a look once again and suggest better option?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141848/new/

https://reviews.llvm.org/D141848



More information about the llvm-commits mailing list