[PATCH] D150859: [llvm-objcopy][ELF] Preserve sh_link to .symtab when applicable
Andrew Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 26 06:42:31 PDT 2023
andrewng added a comment.
>>> I have a comment whether we should make new symbols (while existing symbol indices are unchanged) reset `sh_link` to zero.
>>
>> I did consider this but decided not to reset `sh_link` to `0`. Do you have a reason for why resetting `sh_link` to `0` in this scenario would be better/preferable?
>
> The section content may be a digest of existing symbols. Adding a symbol nullifies its assumption that its content is comprehensive.
> However, I don't have an example that this breaks.
Yes, the number of symbols could differ. I guess resetting `sh_link` to `0` would be the safer option but on the other hand if the user is making such modifications then it could be considered at their own risk.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150859/new/
https://reviews.llvm.org/D150859
More information about the llvm-commits
mailing list