[PATCH] D60042: [llvm-objcopy] Add --prefix-alloc-sections

Seiya Nuta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 2 21:42:33 PDT 2019


seiya added a comment.

In D60042#1451203 <https://reviews.llvm.org/D60042#1451203>, @jhenderson wrote:

> Thanks for the patch. Before this goes in, I'd like to ask one question:
>
> Does GNU objcopy do anything with relocation sections to sections with changed names. I suspect that it renames them to match, but I don't think this patch does that.


It seems so:

  $ echo "int x; int foo() { return x; }" > test.c
  $ clang -c test.c -o test.o
  $ objcopy --prefix-alloc-sections=.alloc_prefix test.o
  $ llvm-readobj --sections test.o | grep Name
  LoadName:
      Name:  (0)
      Name: .alloc_prefix.text (32)
      Name: .rela.alloc_prefix.text (27)
      Name: .comment (51)
      Name: .note.GNU-stack (60)
      Name: .alloc_prefix.eh_frame (81)
      Name: .rela.alloc_prefix.eh_frame (76)
      Name: .symtab (1)
      Name: .strtab (9)
      Name: .shstrtab (17)

I'll update the patch to handle this.


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

https://reviews.llvm.org/D60042





More information about the llvm-commits mailing list