[PATCH] D69260: [yaml2obj] - Make .symtab to be not mandatory section for SHT_REL[A] section.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 07:37:45 PDT 2019


grimar marked an inline comment as done.
grimar added a comment.

> I'm not sure I follow why in most cases adding Symbols: [] is necessary? Could you explain the detailed impact of this change,
>  with regards to when .symtab will/won't be generated

Before this change we generated `.symtab` when there was the `Symbols:` tag in the YAML document and/or when there was a
REL[A] section that has an empty "Link" (i.e. normally it happened when it just was not specified).

After this change we only generate '.symtab' when there is `Symbols:` tag. When there is no 'Symbols:`, we do not generate it.
I.e. this patch lefts no more special handling for REL[A] sections.

> and when the Link: .symtab is/is not required for relocation sections now?

So, if `Link: .symtab` is specified, you must provide the `Symbols:`, otherwise it will not find the referenced symbol table section.
Just like if you provide 'Link: .foo', you have to provide '.foo' section.



================
Comment at: llvm/test/tools/llvm-objcopy/ELF/no-symbol-relocation.test:24
         Type:   R_X86_64_RELATIVE
+## TODO: llvm-objcopy crashes without the following line.
+Symbols: []
----------------
jhenderson wrote:
> Could you file a bug for this issue, if it doesn't already exist, please?
It will be fixed by D69304.


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

https://reviews.llvm.org/D69260





More information about the llvm-commits mailing list