[PATCH] D67689: [llvm-objcopy] Add support for --gap-fill and --pad-to options

Hui Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 22 20:50:47 PDT 2019


Hui added inline comments.


================
Comment at: llvm/test/tools/llvm-objcopy/ELF/gap-fill.test:4
+#
+# clang-7 gapfillpadto.cpp -o gapfillpadto.elf
+# void swap(int *a, int *b) {
----------------
asmith wrote:
> seiya wrote:
> > Is it possible to use yaml2obj instead of adding a binary file? I think we just need few sections to make sure that this patch works well. For example (not tested):
> > 
> > ```
> > !ELF
> > FileHeader:
> >   Class:           ELFCLASS64
> >   Data:            ELFDATA2LSB
> >   Type:            ET_EXEC
> >   Machine:         EM_X86_64
> > Sections:
> >   - Name:            .text
> >     Type:            SHT_PROGBITS
> >     Content:         "AABBCCDD"
> >   - Name:            .foo
> >     Type:            SHT_PROGBITS
> >     Content:         "EEFF"
> >   - Name:            .bar
> >     Type:            SHT_NOBITS
> > ```
> That's a good suggestion. Will look into that.
This patch resizes the section and its containing segments. (Parent or child segment). One main part of the test is to check the section to segment mapping from PHDR. However yam2obj can't keep program headers.  


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67689/new/

https://reviews.llvm.org/D67689





More information about the llvm-commits mailing list