[PATCH] D33964: [LLVM][llvm-objcopy] Added basic plumbing to get things started

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 11:01:35 PDT 2017


jakehehrlich updated this revision to Diff 104464.
jakehehrlich set the repository for this revision to rL LLVM.
jakehehrlich added a comment.

This change adds test coverage for NOBITS and program headers. It turns out there were issues with NOBITS and there were issues with segments. I fixed the bugs exposed as well

Changes from last diff (outside of tests):

1. Some segments (like STACK segments) don't have sections so you can't set their Offset to firstSection()->Offset. This demanded a small change to Segment::finalize
2. Sometimes sections that don't belong in segments would wind up in a PT_LOAD segment that had Offset == 0. This is fixed by only adding allocated sections to segments (see Object::readSectionHeaders)
3. I was unconditionally requesting the contents of a section. This is an error in the NOBITS case so I had to add a check to only request the section contents when there is some. (see Object::readSectionHeaders)




Repository:
  rL LLVM

https://reviews.llvm.org/D33964

Files:
  test/tools/llvm-objcopy/basic-copy.test
  test/tools/llvm-objcopy/hello-world.s
  tools/LLVMBuild.txt
  tools/llvm-objcopy/CMakeLists.txt
  tools/llvm-objcopy/LLVMBuild.txt
  tools/llvm-objcopy/Object.cpp
  tools/llvm-objcopy/Object.h
  tools/llvm-objcopy/llvm-objcopy.cpp
  tools/llvm-objcopy/llvm-objcopy.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33964.104464.patch
Type: text/x-patch
Size: 21903 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170628/585ce782/attachment.bin>


More information about the llvm-commits mailing list