st_size may not be of importance to the abi if you are not using copy relocations. This is helpful when you want to check the abi of a shared object both when instrumented and not because asan will increase the size of objects to include the redzone.
Details
Diff Detail
Unit Tests
Event Timeline
I'd like to see an llvm-ifs Command Guide document wtitten sooner rather than later, since all llvm tools should have one. Please look at doing this soon.
llvm/lib/InterfaceStub/ELFObjHandler.cpp | ||
---|---|---|
222 | Why is Size set to 1 and not 0, which would seem the more natural value? | |
llvm/test/tools/llvm-ifs/strip-size.test | ||
8 | ||
llvm/tools/llvm-ifs/llvm-ifs.cpp | ||
441 | Could you make Sym.Size Optional instead? That would seem like a cleaner interface to me. |
Looks like @haowei already created it. Added documentation for --strip-size
llvm/lib/InterfaceStub/ELFObjHandler.cpp | ||
---|---|---|
222 | Linkers would get upset. https://github.com/llvm/llvm-project/blob/main/lld/ELF/Relocations.cpp#L355-L358 | |
llvm/tools/llvm-ifs/llvm-ifs.cpp | ||
441 | Sure |
llvm/docs/CommandGuide/llvm-ifs.rst | ||
---|---|---|
198 | It would be nice of this wording was made more consistent with other options in this file. | |
llvm/lib/InterfaceStub/ELFObjHandler.cpp | ||
222 | But giving a value of 1 means the relocation becomes invalid? It seems to me if you care about linker behaviour around copy relocations, you can't change their size at all. | |
llvm/lib/InterfaceStub/IFSHandler.cpp | ||
126 | This is a very weird thing to do in a function about writing YAML. Do you need to do it, and if so, do you need to do it here specifically? |
llvm/docs/CommandGuide/llvm-ifs.rst | ||
---|---|---|
198 | Did my best, feel free to suggest something else. | |
llvm/lib/InterfaceStub/ELFObjHandler.cpp | ||
222 | You're right, I like the idea of failing fast when stripping size and using those stubs with non-pic | |
llvm/lib/InterfaceStub/IFSHandler.cpp | ||
126 | Indeed, I think I removed this in the first diff, but accidentally added it back in the second. Thanks |
Three nits, but otherwise LGTM, with the caveat that I'm not a user or regular developer of this tool, so there might be some cases I haven't considered. If there's someone else available to sign off too, that would be good.
llvm/docs/CommandGuide/llvm-ifs.rst | ||
---|---|---|
201–202 | Not sure if the "and" should be "or". | |
llvm/lib/InterfaceStub/IFSHandler.cpp | ||
128 | ||
llvm/tools/llvm-ifs/llvm-ifs.cpp | ||
440 | I'd probably explicitly write out the type of Sym, since it is not obvious from this location (see the coding standards on use of auto). |
It would be nice of this wording was made more consistent with other options in this file.