[PATCH] D56570: [llvm-objcopy] Use SHT_NOTE for added note sections.

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 11 11:58:55 PST 2019


rupprecht added a comment.

In D56570#1353888 <https://reviews.llvm.org/D56570#1353888>, @jhenderson wrote:

> Is it possible to force the type of a section called ".note..." to something other than SHT_NOTE?


I don't think so, but that's also kind of the point of this patch -- without it, there isn't a way to add a .note section and have it be an actual SHT_NOTE. I think .note sections are always expected to be SHT_NOTE (with the noted exception of .note.GNU-stack), so adding it as PROGBITS is weird.



================
Comment at: test/tools/llvm-objcopy/ELF/add-section-special.test:2
+# RUN: yaml2obj %s > %t.o
+# RUN: llvm-objcopy --add-section=.note.foo=/dev/null %t.o %t-regular-note.o
+# RUN: llvm-objcopy --add-section=.note.GNU-stack=/dev/null %t.o %t-gnu-stack.o
----------------
alexshap wrote:
> just to double check - wouldn't this test have troubles on Windows ?
/dev/null seems to be widely used in tests, and llvm-lit explicitly handles /dev/null for "kAvoidDevNull" (which means Windows) here:
https://github.com/llvm/llvm-project/blob/a974b33a10745b528c34f0accbd230b0a4e1fb87/llvm/utils/lit/lit/TestRunner.py#L873

I'll try to find someone to run this on Windows before I submit, but if not, I'll watch buildbots.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D56570





More information about the llvm-commits mailing list