summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
Commit message (Collapse)AuthorAgeFilesLines
...
* Check alignment in getSectionContentsAsArray.Rafael Espindola2017-11-301-0/+21
| | | | | | | | While the ArrayRef can technically have unaligned data, it would be extremely surprising if iterating over it caused undefined behavior when a reference to the underlying type was bound. llvm-svn: 319392
* [AMDGPU][MC][GFX8][GFX9] Corrected names of integer ↵Dmitry Preobrazhensky2017-11-201-4/+4
| | | | | | | | | | | | v_{add/addc/sub/subrev/subb/subbrev} See bug 34765: https://bugs.llvm.org//show_bug.cgi?id=34765 Reviewers: tamazov, SamWot, arsenm, vpykhtin Differential Revision: https://reviews.llvm.org/D40088 llvm-svn: 318675
* [test] Add test files that were missed from SVN r317459Martin Storsjo2017-11-062-0/+0
| | | | llvm-svn: 317461
* [ObjectYAML] Map relocation types for COFF ARMNT and ARM64Martin Storsjo2017-11-061-0/+158
| | | | | | Differential Revision: https://reviews.llvm.org/D39668 llvm-svn: 317459
* llvm/test/Object/archive-SYM64-write.test: Delete large temp files. They are ↵NAKAMURA Takumi2017-11-041-0/+3
| | | | | | 8GiB total. llvm-svn: 317401
* Reland "Add support for writing 64-bit symbol tables for archives when ↵Jake Ehrlich2017-11-031-0/+35
| | | | | | | | | | | | | | | | | | offsets become too large for 32-bit" Tests were failing because some bots were running out of address space and memory. Additionally the test was very slow. These issues were solved by changing the test to take advantage of sparse filse and restricting the test to run only on 64-bit systems. This should fix https://bugs.llvm.org//show_bug.cgi?id=34189 This change makes it so that if writing a K_GNU style archive, you need to output a > 32-bit offset it should output in K_GNU64 style instead. Differential Revision: https://reviews.llvm.org/D36812 llvm-svn: 317352
* Revert "Add support for writing 64-bit symbol tables for archives when ↵Jake Ehrlich2017-10-271-31/+0
| | | | | | | | offsets become too large for 32-bit" This reverts commit r316805. llvm-svn: 316813
* Add support for writing 64-bit symbol tables for archives when offsets ↵Jake Ehrlich2017-10-271-0/+31
| | | | | | | | | | | | | become too large for 32-bit This should fix https://bugs.llvm.org//show_bug.cgi?id=34189 This change makes it so that if writing a K_GNU style archive, you need to output a > 32-bit offset it should output in K_GNU64 style instead. Differential Revision: https://reviews.llvm.org/D36812 llvm-svn: 316805
* Fix buffer overflow.Rafael Espindola2017-10-192-0/+3
| | | | | | We were reading past the end of the buffer. llvm-svn: 316143
* Add base relative relocation record that can be used for the following case ↵Tony Tye2017-10-161-0/+4
| | | | | | | | | | | | | | (OpenCL example): static __global int Var = 0; __global int* Ptr[] = {&Var}; ... In this case Var is a non premptable symbol and so its address can be used as the value of Ptr, with a base relative relocation that will add the delta between the ELF address and the actual load address. Such relocations do not require a symbol. Differential Revision: https://reviews.llvm.org/D38909 llvm-svn: 315935
* Convert an ErrorOr to Expected.Rafael Espindola2017-10-111-1/+3
| | | | | | | getRelocationAddend should never be called on non SHT_RELA sections, but changing that requires changing RelocVisitor.h. llvm-svn: 315473
* Make the ELFFile constructor private.Rafael Espindola2017-10-102-0/+4
| | | | | | | | | With this all clients have to use the new create method which returns an Expected. Fixes a crash on invalid input. llvm-svn: 315376
* Make the ELFObjectFile constructor private.Rafael Espindola2017-10-101-4/+4
| | | | | | | This forces every user to use the new create method that returns an Expected. This in turn propagates better error messages. llvm-svn: 315371
* Convert two uses of ErrorOr to Expected.Rafael Espindola2017-10-101-1/+1
| | | | llvm-svn: 315354
* Added phdr upper bound checks to ElfObject.Rafael Espindola2017-10-052-0/+26
| | | | | | | | | Ensure the program_headers call will fail correctly if the program headers are larger than the underlying buffer. Patch by Parker Thompson! llvm-svn: 315012
* AMDGPU: Add and set AMDGPU-specific e_flagsKonstantin Zhuravlyov2017-10-054-33/+106
| | | | | | Differential Revision: https://reviews.llvm.org/D38556 llvm-svn: 314987
* AMDGPU: Add ELFOSABI_AMDGPU_MESA3DKonstantin Zhuravlyov2017-10-031-0/+21
| | | | | | Differential Revision: https://reviews.llvm.org/D38387 llvm-svn: 314846
* AMDGPU: Add ELFOSABI_AMDGPU_PALKonstantin Zhuravlyov2017-10-033-2/+23
| | | | llvm-svn: 314843
* [llvm-readobj][RISCV] Pretty-print RISCV e_flagsAlex Bradbury2017-10-031-0/+7
| | | | llvm-svn: 314772
* [RISCV] Add missed test case for r314770Alex Bradbury2017-10-032-0/+19
| | | | | | | Differential Revision: https://reviews.llvm.org/D38311 Patch by https://reviews.llvm.org/D38311 llvm-svn: 314771
* llvm-ar: align the first archive member consistently.Rafael Espindola2017-09-221-1/+9
| | | | | | | Before we were aligning the member after the symbol table to 4 but other members to 8. llvm-svn: 314010
* llvm-ar: Don't add an unnecessary alignment in gnu mode.Rafael Espindola2017-09-221-0/+8
| | | | | | | This is mostly for getting stricter testing in preparation for future changes. llvm-svn: 314000
* [yaml2obj] - Don't crash on one more invalid document.George Rimar2017-09-211-0/+4
| | | | | | | | | This fixes one more crash I faced. Testcase contains minimal reduced case. Differential revision: https://reviews.llvm.org/D38082 llvm-svn: 313868
* Revert r313746 "[yaml2obj] - Don't crash on invalid document."George Rimar2017-09-201-2/+0
| | | | | | | It broke BB: http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/9781 llvm-svn: 313748
* [yaml2obj] - Don't crash on invalid document.George Rimar2017-09-201-0/+2
| | | | | | | | | | Previously jaml2obj would segfault on empty document. (without yaml description). Patch fixes the issue. Differential revision: https://reviews.llvm.org/D38036 llvm-svn: 313746
* [MachO] Prevent heap overflow when load command extends past EOFJonas Devlieghere2017-09-132-0/+3
| | | | | | | | | | | This patch fixes a heap-buffer-overflow when a malformed Mach-O has a load command who's size extends past the end of the binary. Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3225 Differential revision: https://reviews.llvm.org/D37439 llvm-svn: 313145
* llvm-dwarfdump: Make -brief the default and add a -verbose option instead.Adrian Prantl2017-09-111-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D37717 llvm-svn: 312972
* llvm-dwarfdump: Replace -debug-dump=sect option with individual options.Adrian Prantl2017-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | As discussed on llvm-dev in http://lists.llvm.org/pipermail/llvm-dev/2017-September/117301.html this changes the command line interface of llvm-dwarfdump to match the one used by the dwarfdump utility shipping on macOS. In addition to being shorter to type this format also has the advantage of allowing more than one section to be specified at the same time. In a nutshell, with this change $ llvm-dwarfdump --debug-dump=info $ llvm-dwarfdump --debug-dump=apple-objc becomes $ dwarfdump --debug-info --apple-objc Differential Revision: https://reviews.llvm.org/D37714 llvm-svn: 312970
* Use the section name if a STT_SECTION symbol has empty name.Rafael Espindola2017-09-062-18/+44
| | | | | | | | | | | | | Without this we would have multiple relocations pointing to symbols with the same name: the empty string. There was no way for yaml2obj to be able to handle that. A more general solution would be to unique symbol names in a similar way to how we unique section names. In practice I think this covers all common cases and is a bit more user friendly than using names like sym1, sym2, sym3, etc. llvm-svn: 312603
* obj2yaml: Print unique section names.Rafael Espindola2017-09-051-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch passing a .o file with multiple sections with the same name to obj2yaml produces a yaml file that yaml2obj cannot handle. This is pr34162. The problem is that when specifying, for example, the section of a symbol, we get only Section: foo and don't know which of the sections whose name is foo we have to use. One alternative would be to use section numbers. This would work, but the output from obj2yaml would be very inconvenient to edit as deleting a section would invalidate all indexes. Another alternative would be to invent a unique section id that would exist only on yaml. This would work, but seems a bit heavy handed. We could make the id optional and default it to the section name. Since in the last alternative the id is basically what this patch uses as a name, it can be implemented as a followup patch if needed. llvm-svn: 312585
* [WebAssembly] Update relocation names to match specSam Clegg2017-09-011-1/+1
| | | | | | | | Summary: See https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md Differential Revision: https://reviews.llvm.org/D37385 llvm-svn: 312342
* [WebAssembly] Fix getSymbolValue() for data symbolsSam Clegg2017-08-311-1/+1
| | | | | | | | | | This is mostly a fix for the output of `llvm-nm` See Bug 34392: https://bugs.llvm.org//show_bug.cgi?id=34392 Differential Revision: https://reviews.llvm.org/D37359 llvm-svn: 312294
* [WebAssembly] Fix overflow for input with missing versionJonas Devlieghere2017-08-232-0/+2
| | | | | | Differential revision: https://reviews.llvm.org/D37070 llvm-svn: 311605
* Fix archive-update.test after r311296.Kuba Mracek2017-08-201-22/+22
| | | | llvm-svn: 311299
* Remove uses of "%T" from test/Object/archive-* tests.Kuba Mracek2017-08-205-5/+5
| | | | llvm-svn: 311296
* Revert archive-* tests from r310953, there were test failures.Kuba Mracek2017-08-155-5/+5
| | | | llvm-svn: 310974
* [llvm] Get rid of "%T" expansionsKuba Mracek2017-08-156-12/+12
| | | | | | | | | | The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t. This patch removes %T in llvm. Differential Revision: https://reviews.llvm.org/D36495 llvm-svn: 310953
* [LTO] Prevent dead stripping and internalization of symbols with sectionsTeresa Johnson2017-07-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Summary: ELF linkers generate __start_<secname> and __stop_<secname> symbols when there is a value in a section <secname> where the name is a valid C identifier. If dead stripping determines that the values declared in section <secname> are dead, and we then internalize (and delete) such a symbol, programs that reference the corresponding start and end section symbols will get undefined reference linking errors. To fix this, add the section name to the IRSymtab entry when a symbol is defined in a specific section. Then use this in the gold-plugin to mark the symbol as external and visible from outside the summary when the section name is a valid C identifier. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D35639 llvm-svn: 309009
* [llvm-readobj] - Teach readobj to print DT_FILTER dynamic tag in human ↵George Rimar2017-07-142-7/+7
| | | | | | | | | | | readable form. Nothing special here, output format is similar to the format used by binutils readelf and ELF Tool Chain readelf. Differential revision: https://reviews.llvm.org/D35351 llvm-svn: 308033
* [WebAssembly] Be consistent in generating trivial test input filesSam Clegg2017-07-105-7/+35
| | | | | | | | | | | | | For each checked-in wasm file, make sure the there is corresponding .ll file that can be used to regenerate it if needed. Add test/Object/Inputs/trivial-object-test.wasm to match other formats and add some new wasm tests in test/Object. Differential Revision: https://reviews.llvm.org/D35213 llvm-svn: 307585
* [YAML] - Teach yaml2obj/obj2yaml to work with numeric relocation values.George Rimar2017-06-301-0/+29
| | | | | | | | | | | | | That may be useful if we want to produce or parse object containing broken relocation values using yaml2obj/obj2yaml. Previously that was impossible because only enum values were parsed correctly, this patch allows to put any numeric value as a relocation type. Differential revision: https://reviews.llvm.org/D34758 llvm-svn: 306814
* Object: Teach irsymtab::read() to try to use the irsymtab that we wrote to disk.Peter Collingbourne2017-06-271-0/+13
| | | | | | | | Fixes PR27551. Differential Revision: https://reviews.llvm.org/D33974 llvm-svn: 306488
* Bitcode: Write the irsymtab to disk.Peter Collingbourne2017-06-273-0/+52
| | | | | | Differential Revision: https://reviews.llvm.org/D33973 llvm-svn: 306487
* obj2yaml: Improve error reportingSam Clegg2017-06-161-1/+1
| | | | | | | | | | Previously only the error codes were reported which meant that useful information about malformed inputs was not shown. Differential Revision: https://reviews.llvm.org/D34008 llvm-svn: 305609
* test: fix hexagon buildSaleem Abdulrasool2017-06-053-0/+3
| | | | | | Add a x86-registered-target requirement to the tests. llvm-svn: 304739
* AMDGPU: Remove deprecated and unused elf definitionsKonstantin Zhuravlyov2017-06-051-15/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D33689 llvm-svn: 304737
* CodeGen: add support for emitting ObjC image infoSaleem Abdulrasool2017-06-053-0/+42
| | | | | | | | | This ensures that we can emit the ObjC Image Info structure on COFF and ELF as well. The frontend already would attempt to emit this information but would get dropped when generating assembly or an object file. llvm-svn: 304736
* Add support for handling ifuncs to GlobalValue::getBaseObjectTeresa Johnson2017-05-151-1/+1
| | | | | | | | | | | | | | | | | Summary: All GlobalIndirectSymbol types (not just GlobalAlias) should return their base object. Without this patch LTO would warn "Unable to determine comdat of alias!" for an ifunc. Reviewers: pcc Subscribers: mehdi_amini, inglorion, llvm-commits Differential Revision: https://reviews.llvm.org/D33202 llvm-svn: 303096
* Add an extra test for archive symbol tables.Rafael Espindola2017-05-151-0/+19
| | | | | | The table should include only defined symbols. llvm-svn: 303075
* [COFF] Gracefully handle empty .drectve sectionsShoaib Meenai2017-05-142-0/+17
| | | | | | | | | | | | | | | | | | Running `llvm-readobj -coff-directives msvcrt.lib` resulted in this error: Invalid data was encountered while parsing the file This happened because some of the object files in the archive have empty `.drectve` sections. These empty sections result in a `parse_failed` error being returned from `COFFObjectFile::getSectionContents()`, which in turn caused `llvm-readobj` to stop. With this change, `getSectionContents` now returns success, and like before the resulting array is empty. Patch by Dave Lee. Differential Revision: https://reviews.llvm.org/D32652 llvm-svn: 303014
OpenPOWER on IntegriCloud