[PATCH] D65446: [yaml2obj/obj2yaml] - Add a basic support for extended section indexes.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 7 07:35:23 PDT 2019
grimar added inline comments.
================
Comment at: test/tools/obj2yaml/elf-sht-symtab-shndx.yaml:21
+# CASE1-NEXT: EntSize: 0x0000000000000004
+# CASE1-NEXT: Content: '000000000100000002000000'
+# CASE1-NEXT: Symbols:
----------------
jhenderson wrote:
> grimar wrote:
> > jhenderson wrote:
> > > I think it would be clearer for obj2yaml to emit an array of entries (and yaml2obj to consume them). What do you think? (We should allow explicit EntSize/Content in the YAML to allow creation of broken stuff too).
> > >
> > > ```
> > > - Name: .symtab_shndx
> > > Type: SHT_SYMTAB_SHNDX
> > > Link: .symtab
> > > Entries:
> > > - Value: 0
> > > - Value: 1
> > > - Value: 42
> > > ```
> > Sounds good. What about me doing this in a follow-up or do you prefer to have this from the start?
> As obj2yaml should probably print the array version, that should be in first, otherwise you just have to update this test (but it's okay to then defer adding custom content to a later change if you want).
I switched to `Entries` in this patch. This required adding a bit more code.
================
Comment at: test/tools/yaml2obj/elf-sht-symtab-shndx.yaml:29
+# RUN: yaml2obj --docnum=2 %s -o %t2
+# RUN: llvm-readobj --sections --symbols 2>&1 %t2 | FileCheck %s --check-prefix=CASE2
+
----------------
jhenderson wrote:
> You could use --section-data to print the bytes of the symbol table and check those maybe?
Yes, done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65446/new/
https://reviews.llvm.org/D65446
More information about the llvm-commits
mailing list