1 # Verify that --add-section can be used to add a note section which is
2 # successfully interpreted by tools that read notes.
4 # Add [namesz, descsz, type, name, desc] for a build id.
5 # RUN: echo -e -n "\x04\x00\x00\x00" > %t-note.bin
6 # RUN: echo -e -n "\x10\x00\x00\x00" >> %t-note.bin
7 # RUN: echo -e -n "\x03\x00\x00\x00" >> %t-note.bin
8 # RUN: echo -e -n "GNU\x00" >> %t-note.bin
9 # RUN: echo -e -n "\x00\x01\x02\x03" >> %t-note.bin
10 # RUN: echo -e -n "\x04\x05\x06\x07" >> %t-note.bin
11 # RUN: echo -e -n "\x08\x09\x0a\x0b" >> %t-note.bin
12 # RUN: echo -e -n "\x0c\x0d\x0e\x0f" >> %t-note.bin
14 # RUN: yaml2obj %s -o %t.o
15 # RUN: llvm-objcopy --add-section=.note.gnu.build-id=%t-note.bin %t.o %t-with-note.o
16 # RUN: llvm-readobj --notes %t-with-note.o | FileCheck %s
26 # CHECK-NEXT: NoteSection {
27 # CHECK-NEXT: Name: .note.gnu.build-id
31 # CHECK-NEXT: Owner: GNU
32 # CHECK-NEXT: Data size: 0x10
33 # CHECK-NEXT: Type: NT_GNU_BUILD_ID
34 # CHECK-NEXT: Build ID: 000102030405060708090a0b0c0d0e0f