This change adds support for adding progbits sections with contents from a file.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Test case?
tools/llvm-objcopy/Object.h | ||
---|---|---|
129 | I'm not convinced about the name of the class - how is it different from a Section? It's primarily because the data is owned, isn't it? Perhaps OwnedDataSection? What do you think? | |
tools/llvm-objcopy/llvm-objcopy.cpp | ||
116 | Has this line been clang-formatted? It looks quite long. |
tools/llvm-objcopy/Object.h | ||
---|---|---|
129 | Yep the point is that it owns the data. That seems like a better name. I'll switch it to that. |
- Added test. I think I just didn't run git add -A before I ran git diff last time
- Changed names
- Fixed formatting issues.
tools/llvm-objcopy/llvm-objcopy.cpp | ||
---|---|---|
184–197 | It looks like GNU objcopy does add-section after removal of sections. I think we should do the same, so this block of code should move after the removeSections call, but before finalize. Also, a test demonstrating this point would be good. This behaviour makes sense, because it allows you to replace the section contents of an existing section. By the way, I also discovered that for some reason, GNU objcopy won't let you add another instance of a section that already exists. I don't think we need to match this behaviour - it's perfectly valid to add such a section. |
I agree on the points about replacement and about not following what GNU objcopy does on duplicate sections.
- Added test to show that you can replace a section using --remove-section and --add-section
- Moved the AddSection code to after section removal.
I'm not convinced about the name of the class - how is it different from a Section? It's primarily because the data is owned, isn't it?
Perhaps OwnedDataSection? What do you think?