Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This looks sensible to me, thanks!
I think we should let @jhenderson have a look at it still though. I think he's out at the moment, but he's hopefully back soon. (Then again, the 14.x branch is happening soon, and in case he's not back before then, and if you have a need to have this included in the branch, I think it could be ok to go ahead sooner, and deal with other feedback later.)
Sounds good.
llvm/test/tools/llvm-objcopy/COFF/update-section.test | ||
---|---|---|
11 | Use llvm-readobj -S -x .text to test the section header and dump the content. | |
21 | Add a test for an IMAGE_SCN_CNT_UNINITIALIZED_DATA section like .bss. There should be an error similar to ELF SHT_NOBITS | |
27 | Consider adding another section and testing two --update-section |
llvm/test/tools/llvm-objcopy/COFF/update-section.test | ||
---|---|---|
21 | This works because the data size is 0. Do you want an explicit check for IMAGE_SCN_CNT_UNINITIALIZED_DATA? |
ELF has such a diagnostic
% fllvm-objcopy --update-section .bss=xxx a.o b.o /tmp/RelA/bin/llvm-objcopy: error: 'a.o': section '.bss' can't be updated because it does not have contents % objcopy --update-section .bss=xxx a.o b.o objcopy: b.o[.bss]: section has no contents
(I might use cannot instead of "can't" for the ELF diagnostic.)
PE/COFF may need something similar.
llvm/test/tools/llvm-objcopy/COFF/update-section.test | ||
---|---|---|
17 | Align the values, i.e. # SMALLER: Section { # SMALLER-NEXT: Number: 1 # SMALLER-NEXT: Name: .text # SMALLER-NOT: } # SMALLER: RawDataSize: 4 And use NOT: } to ensure RawDataSize is in the same Section. | |
llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp | ||
258 | ||
266 | ||
269 |
I agree it'd be great to let @jhenderson have a look at it, but seem fine to catch up the 14.x branch and address other issues.
llvm/test/tools/llvm-objcopy/COFF/update-section.test | ||
---|---|---|
38 | Hex dump of section '.text': should be aligned, too. | |
49 | This needs a diagnostic. | |
70 | delete unused symbols: |
llvm/test/tools/llvm-objcopy/COFF/update-section.test | ||
---|---|---|
17 | Just confirming that it is deliberate to keep the section size the same, padded with 0? For ELF, the section is shrunk, which feels more like what I'd expect. | |
26–27 | I have a minor preference for the suggested edit style for flowing over multiple lines. | |
50 | If this is a system error message, there may be a between different OS versions. I believe lit now has substitutions for common error messages to handle this. Look for "%errc_ENOENT" for example usage. |
llvm/test/tools/llvm-objcopy/COFF/update-section.test | ||
---|---|---|
17 | I've changed the size of the section |
Use llvm-readobj -S -x .text to test the section header and dump the content.