brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 839378b Raw
40 lines · plain
1# Verify that --add-section can be used to add a note section which is2# successfully interpreted by tools that read notes.3 4# Add [namesz, descsz, type, name, desc] for a build id.5# RUN: echo -e -n "\x04\x00\x00\x00" >  %t-note.bin6# RUN: echo -e -n "\x10\x00\x00\x00" >> %t-note.bin7# RUN: echo -e -n "\x03\x00\x00\x00" >> %t-note.bin8# RUN: echo -e -n "GNU\x00"          >> %t-note.bin9# RUN: echo -e -n "\x00\x01\x02\x03" >> %t-note.bin10# RUN: echo -e -n "\x04\x05\x06\x07" >> %t-note.bin11# RUN: echo -e -n "\x08\x09\x0a\x0b" >> %t-note.bin12# RUN: echo -e -n "\x0c\x0d\x0e\x0f" >> %t-note.bin13 14# RUN: yaml2obj %s -o %t.o15# RUN: llvm-objcopy --add-section=.note.gnu.build-id=%t-note.bin %t.o %t-with-note.o16# RUN: llvm-readobj --notes %t-with-note.o | FileCheck %s17 18!ELF19FileHeader:20  Class:           ELFCLASS6421  Data:            ELFDATA2LSB22  Type:            ET_REL23  Machine:         EM_X86_6424 25# CHECK:      NoteSections [26# CHECK-NEXT:   NoteSection {27# CHECK-NEXT:     Name: .note.gnu.build-id28# CHECK-NEXT:     Offset:29# CHECK-NEXT:     Size:30# CHECK-NEXT:     Notes [31# CHECK-NEXT:     {32# CHECK-NEXT:       Owner: GNU33# CHECK-NEXT:       Data size: 0x1034# CHECK-NEXT:       Type: NT_GNU_BUILD_ID35# CHECK-NEXT:       Build ID: 000102030405060708090a0b0c0d0e0f36# CHECK-NEXT:     }37# CHECK-NEXT:   ]38# CHECK-NEXT:   }39# CHECK-NEXT: ]40