[PATCH] D59496: [llvm-objcopy] - Fix a st_name of the first symbol table entry.

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 19 17:38:33 PDT 2019


jakehehrlich added a comment.

The current implementation in this change was what I had in mind but I have questions now. I think this implementation is wrong

1. Is a zero index not ensured to point to the empty string according to the standard?
2. If you need a symbol with an empty string for a name are you expected to use a non-zero index or a zero index to represent the empty string?
3. Regardless of what string table is present, does the zero index always represent the empty string? That seems impossible since you'd always need a dummy character at the start which might as well be a zero. I think we're expecting this behavior right now and it doesn't seem right to me. Consider "bat\0" as a string table with a symbol named "" and a symbol named "bat\0". I think the symbol named "" should have index 3 not 0 and that the symbol named "bat" should have index 0.

Maybe the correct implementation is to special case the dummy symbol and then to leave the string table implementation unchanged.


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

https://reviews.llvm.org/D59496





More information about the llvm-commits mailing list