summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-readobj/gnu-notes.test
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-readobj][test] - Move platform specific test cases and their inputs to ↵Georgii Rymar2019-12-101-194/+0
| | | | | | | | | | | | separate folders. This creates the next subfolders in the test directory: "COFF", "ELF", "MachO", "wasm". I've also removed platform specific prefixes, like "coff-*". One unused binary was removed as well: `Inputs/relocs.obj.elf-mips` Differential revision: https://reviews.llvm.org/D71203
* [yaml2obj, obj2yaml] - Add support for SHT_NOTE sections.georgerim2019-10-251-4/+8
| | | | | | | | | | | | | | | | | | | | | SHT_NOTE is the section that consists of namesz, descsz, type, name + padding, desc + padding data. This patch teaches yaml2obj, obj2yaml to dump and parse them. This patch implements the section how it is described here: https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-18048.html Which says: "For 64–bit objects and 32–bit objects, each entry is an array of 4-byte words in the format of the target processor" The official specification is different http://www.sco.com/developers/gabi/latest/ch5.pheader.html#note_section And says: "n 64-bit objects (files with e_ident[EI_CLASS] equal to ELFCLASS64), each entry is an array of 8-byte words in the format of the target processor. In 32-bit objects (files with e_ident[EI_CLASS] equal to ELFCLASS32), each entry is an array of 4-byte words in the format of the target processor" Since LLVM uses the first, 32-bit way, this patch follows it. Differential revision: https://reviews.llvm.org/D68983
* [yaml2obj] Write the section header table after section contentsFangrui Song2019-09-051-8/+8
| | | | | | | | | | | | | | | | | Linkers (ld.bfd/gold/lld) place the section header table at the very end. This allows tools to strip it, which is optional in executable/shared objects. In addition, if we add or section, the size of the section header table will change. Placing the section header table in the end keeps section offsets unchanged. yaml2obj currently places the section header table immediately after the program header. Follow what linkers do to make offset updating easier. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D67221 llvm-svn: 371074
* [llvm-readobj] Unwrap the value first to avoid the errorPetr Hosek2019-08-171-5/+5
| | | | | | | | | This addresses the issue introduced in r369169, we need to unwrap the value first before we can check whether it's empty. This also swaps the two branches to put the common path first which should be NFC. llvm-svn: 369177
* [llvm-readobj] Fallback to PT_NOTE if file doesn't have sectionsPetr Hosek2019-08-161-3/+29
| | | | | | | | | This is useful when trying to read notes from stripped files and matches the behavior of GNU readelf and eu-readelf. Differential Revision: https://reviews.llvm.org/D66358 llvm-svn: 369169
* [llvm-readobj] - Remove 'error(Error EC)' helper.George Rimar2019-08-131-12/+12
| | | | | | | | | We do not need it. I replaced it with reportError(StringRef Input, Error Err). Differential revision: https://reviews.llvm.org/D66011 llvm-svn: 368677
* [llvm-readelf] --notes: move 'Data size' column left by 1Fangrui Song2019-08-071-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | readelf -n: ``` // "Data size" is not left justified Owner Data size Description GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag) ``` llvm-readelf -n (before): ``` // "Data size" column shifted by 1 Owner Data size Description GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag) ``` llvm-readelf -n (after): ``` Owner Data size Description GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag) ``` This change is made to reduce the diff with readelf -n, so that it is slightly easier to check what features readelf implements but we don't. Reviewed By: grimar, jhenderson Differential Revision: https://reviews.llvm.org/D65847 llvm-svn: 368138
* [Object/ELF] - Improve error reporting for notes.George Rimar2019-07-121-75/+117
| | | | | | | | | | This patch improves the error messages reported for note sections and phdrs and also makes a cleanup for existent test case. Differential revision: https://reviews.llvm.org/D64470 llvm-svn: 365884
* Revert r365775 - "[Object/ELF] - Improve error reporting for notes."George Rimar2019-07-111-117/+75
| | | | | | It broke BB: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/15419 llvm-svn: 365779
* [Object/ELF] - Improve error reporting for notes.George Rimar2019-07-111-75/+117
| | | | | | | | | | This patch improves the error messages reported for note sections and phdrs and also makes a cleanup for existent test case. Differential revision: https://reviews.llvm.org/D64470 llvm-svn: 365775
* [llvm-readobj] Change -long-option to --long-option in tests. NFCFangrui Song2019-05-011-2/+2
| | | | | | | | | | We use both -long-option and --long-option in tests. Switch to --long-option for consistency. In the "llvm-readelf" mode, -long-option is discouraged as it conflicts with grouped short options and it is not accepted by GNU readelf. While updating the tests, change llvm-readobj -s to llvm-readobj -S to reduce confusion ("s" is --section-headers in llvm-readobj but --symbols in llvm-readelf). llvm-svn: 359649
* [yaml2obj][obj2yaml] - Change how symbol's binding is descibed when ↵George Rimar2019-04-031-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parsing/dumping. Currently, YAML has the following syntax for describing the symbols: Symbols: Local: LocalSymbol1: ... LocalSymbol2: ... ... Global: GlobalSymbol1: ... Weak: ... GNUUnique: I.e. symbols are grouped by their bindings. That is not very convenient, because: It does not allow to set a custom binding, what can be useful for producing broken/special outputs for test cases. Adding a new binding would require to change a syntax (what we observed when added GNUUnique recently). It does not allow to change the order of the symbols in .symtab/.dynsym, i.e. currently all Local symbols are placed first, then Global, Weak and GNUUnique are following, but we are not able to change the order. It is not consistent. Binding is just one of the properties of the symbol, we do not group them by other properties. It makes the code more complex that it can be. This patch shows it can be simplified with the change performed. The patch changes the syntax to just: Symbols: Symbol1: ... Symbol2: ... ... With that, we are able to work with the binding field just like with any other symbol property. Differential revision: https://reviews.llvm.org/D60122 llvm-svn: 357595
* [llvm-readobj] Implement LLVM style printer for --notesJordan Rupprecht2018-11-071-9/+53
| | | | | | | | | | | | | | | | | Summary: Port the GNU style printNotes method to the LLVMStyle subclass. This is basically just a heavy refactor so that the note parsing/formatting logic from the GNUStyle::printNotes can be shared with LLVMStyle::printNotes. Reviewers: MaskRay Reviewed By: MaskRay Subscribers: dschuff, fedor.sergeev, llvm-commits Differential Revision: https://reviews.llvm.org/D54220 llvm-svn: 346371
* llvm-readobj: add support for printing GNU NotesSaleem Abdulrasool2016-08-301-0/+76
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. llvm-svn: 280131
OpenPOWER on IntegriCloud