The ELF side of llvm-objcopy also strips undefined local symbols that are unreferenced with --strip-unneeded. Should that be the same in COFF?
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.
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.
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.
Yes, especially as the output actually should be different in this case, after adding a testcase of undefined local symbols.
|15 ↗||(On Diff #181236)|
Thinking about it, it's probably worth having an undefined external too.
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).