[PATCH] D42872: Fix handling of zero-size segments in llvm-objcopy

vit9696 via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 02:39:38 PST 2018


vit9696 updated this revision to Diff 133181.
vit9696 added a comment.

@jhenderson, sorry for my ignorance, but I miss the point of your .bss example just a second time. Could you elaborate a little more?

As I see it, if a file has a segment with a single .bss section with FileSize set to 0, this segment will not occupy any area in the file itself. For this reason setting its Offset to anything but zero makes no sense, because there could be no valid offset to the data in the file which is not existent.

I updated a test with a typo fix and included your comment rewording suggestions.

Also, I don't think yaml2obj supports segments with 0 FileSize and non-zero MemSize. Perhaps I simply failed to find a way to do it, in this case, could anyone give me a hint?


Repository:
  rL LLVM

https://reviews.llvm.org/D42872

Files:
  test/tools/llvm-objcopy/marker-segment.test
  tools/llvm-objcopy/Object.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42872.133181.patch
Type: text/x-patch
Size: 3960 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180207/f0346ef9/attachment.bin>


More information about the llvm-commits mailing list