Details
Diff Detail
Event Timeline
test/tools/llvm-objcopy/COFF/strip-unneeded.yaml | ||
---|---|---|
1 | The ELF side of llvm-objcopy also strips undefined local symbols that are unreferenced with --strip-unneeded. Should that be the same in COFF? | |
8–9 | Just to confirm, this is what GNU objcopy does? The ELF side attempts to strip local symbols in this case whether they're referenced or not. Another difference between the two is that undefined locals are stripped by strip-unneeded, but not discard-all. | |
11 | I have a marginal preference to use a different output file name for each case. This allows a user to inspect the corresponding output file, should the need arise, without having to mess about with the test. |
test/tools/llvm-objcopy/COFF/strip-unneeded.yaml | ||
---|---|---|
8–9 | GNU objcopy doesn't strip referenced local symbols, but undefined locals (which I wasn't even aware of being a thing) does indeed seem to have the difference you mention. I'll implement that. | |
11 | Yes, especially as the output actually should be different in this case, after adding a testcase of undefined local symbols. |
Did the suggested changes to the test, added the distinction that --discard-all keeps undefined local symbols.
test/tools/llvm-objcopy/COFF/strip-unneeded.yaml | ||
---|---|---|
8–9 | Okay, as there's now a behaviour difference, please split discard-all into a separate test. |
Split testes into two separate files, with one shared yaml source in the Inputs directory.
test/tools/llvm-objcopy/COFF/Inputs/discard-locals.yaml | ||
---|---|---|
15 ↗ | (On Diff #181236) | Thinking about it, it's probably worth having an undefined external too. |
tools/llvm-objcopy/COFF/COFFObjcopy.cpp | ||
53–54 | GNU objcopy (probably) doesn't have a "Config.DiscardAll" member. Change this and the StripUnneeded reference to switch names (i.e. --discard-all/--strip-unneeded). |
Added an undefined external to the tests, changed the code comment to use CLI parameter names.
The ELF side of llvm-objcopy also strips undefined local symbols that are unreferenced with --strip-unneeded. Should that be the same in COFF?