Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
test/tools/llvm-objcopy/COFF/only-keep-debug.yaml | ||
---|---|---|
4 ↗ | (On Diff #182243) | -sections -> --sections |
tools/llvm-objcopy/COFF/COFFObjcopy.cpp | ||
34–36 ↗ | (On Diff #182243) | I think you should just inline this. |
39 ↗ | (On Diff #182243) | Would it make more sense for this to be after section removal, so that it has less work to do? |
41 ↗ | (On Diff #182243) | Remove the word "data" here, unless "content data" is a COFF phrasing. |
Applied @jhenderson's suggestions. But I also split the input data into a separate yaml file in Inputs, as I'm going to use the same input for another test.
test/tools/llvm-objcopy/COFF/Inputs/only-keep-sections.yaml | ||
---|---|---|
1 ↗ | (On Diff #182370) | If this yaml file is going to be used in other tests, it should be more generically named (unless the other tests also involve "only-keep-sections"). |
1 ↗ | (On Diff #182370) | Wait, never mind. I got myself mixed up about the switch name and this! |
test/tools/llvm-objcopy/COFF/only-keep-debug.test | ||
7–9 ↗ | (On Diff #182370) | This comment is a little clunky. Perhaps rephrase it to something like: Check that all non-debug/buildid sections with IMAGE_SCN_CNT_CODE or IMAGE_SCN_CNT_INITIALIZED_DATA are truncated, and none others. |
tools/llvm-objcopy/COFF/COFFObjcopy.cpp | ||
51–53 ↗ | (On Diff #182370) | Nit of nits: don't shorten comment lines unnecessarily. clang-format will insert new lines to make them conform to the character width, but won't make them longer if they are unnecessarily short. |
LGTM, assuming this matches GNU objcopy.
test/tools/llvm-objcopy/COFF/only-keep-debug.test | ||
---|---|---|
5 ↗ | (On Diff #182524) | You don't need to change this, but the GNU style of llvm-readobj also provides symbol dumping in the style you are looking at. It may be useful to use that instead, if you want to keep things to one run of llvm-readobj. |
8 ↗ | (On Diff #182524) | Oops, that should be "no others". |
test/tools/llvm-objcopy/COFF/only-keep-debug.test | ||
---|---|---|
5 ↗ | (On Diff #182524) | Yes, or invoke "llvm-readelf" instead of "llvm-readobj" sets that flag (among a few other minor tweaks). But it looks like that flag is only used in ELFDumper which explains why nothing changes for COFF. If you're feeling adventurous, you might want to handle that in COFFDumper, but that would be a major patch. |