forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
llvm-readobj: add support for printing GNU Notes
Add support for printing the GNU Notes. This allows an easy way to view the build id for a binary built with the build id. Currently, this only handles the GNU notes, though it would be easy to extend for other note types (default, FreeBSD, NetBSD, etc). Only the GNU style is supported currently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280131 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
4 changed files
with
221 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# RUN: yaml2obj %s > %t.so | ||
# RUN: llvm-readobj -elf-output-style GNU --notes %t.so | FileCheck %s | ||
|
||
# CHECK: Displaying notes found at file offset 0x00000300 with length 0x00000020: | ||
# CHECK: Owner Data size Description | ||
# CHECK: GNU 0x00000010 NT_GNU_BUILD_ID (unique build ID bitstring) | ||
# CHECK: Build ID: 4fcb712aa6387724a9f465a32cd8c14b | ||
|
||
# CHECK: Displaying notes found at file offset 0x0000036c with length 0x0000001c: | ||
# CHECK: Owner Data size Description | ||
# CHECK: GNU 0x00000009 NT_GNU_GOLD_VERSION (gold version) | ||
# CHECK: Version: gold 1.11 | ||
|
||
--- !ELF | ||
FileHeader: | ||
Class: ELFCLASS64 | ||
Data: ELFDATA2LSB | ||
Type: ET_EXEC | ||
Machine: EM_X86_64 | ||
Sections: | ||
- Name: .note.gnu.build-id | ||
Type: SHT_NOTE | ||
Flags: [ SHF_ALLOC ] | ||
Address: 0x0000000000400120 | ||
AddressAlign: 0x0000000000000004 | ||
Content: 040000001000000003000000474E55004FCB712AA6387724A9F465A32CD8C14B | ||
- Name: .text | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] | ||
Address: 0x0000000000400140 | ||
AddressAlign: 0x0000000000000001 | ||
Content: 31C0C3 | ||
- Name: .eh_frame | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_ALLOC ] | ||
Address: 0x0000000000400148 | ||
AddressAlign: 0x0000000000000008 | ||
Content: 1400000000000000017A5200017810011B0C070890010000140000001C000000D8FFFFFF030000000000000000000000 | ||
- Name: .data | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_WRITE, SHF_ALLOC ] | ||
Address: 0x0000000000401000 | ||
AddressAlign: 0x0000000000000001 | ||
Content: '' | ||
- Name: .bss | ||
Type: SHT_NOBITS | ||
Flags: [ SHF_WRITE, SHF_ALLOC ] | ||
Address: 0x0000000000401000 | ||
AddressAlign: 0x0000000000000001 | ||
- Name: .comment | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_MERGE, SHF_STRINGS ] | ||
AddressAlign: 0x0000000000000001 | ||
Content: 004743433A2028474E552920352E342E3000 | ||
- Name: .note.gnu.gold-version | ||
Type: SHT_NOTE | ||
AddressAlign: 0x0000000000000004 | ||
Content: 040000000900000004000000474E5500676F6C6420312E3131000000 | ||
Symbols: | ||
Local: | ||
- Name: reduced.c | ||
Type: STT_FILE | ||
- Type: STT_FILE | ||
Global: | ||
- Name: main | ||
Type: STT_FUNC | ||
Section: .text | ||
Value: 0x0000000000400140 | ||
Size: 0x0000000000000003 | ||
- Name: _edata | ||
Value: 0x0000000000401000 | ||
- Name: __bss_start | ||
Value: 0x0000000000401000 | ||
- Name: _end | ||
Value: 0x0000000000401000 | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters