summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/XCOFFObjectFile.cpp
Commit message (Collapse)AuthorAgeFilesLines
* The patch is the compiler error specific on the compile error on CMVCdiggerlin2019-11-191-3/+5
| | | | | | | | | | | | | | | | | | | | | | | SUMMARY: CMVC has a compiler error on the const uint64_t OffsetToRaw = is64Bit() ? toSection64(Sec)->FileOffsetToRawData : toSection32(Sec)->FileOffsetToRawData; while gcc compiler do not have the problem. I have to change the code to uint64_t OffsetToRaw; if (is64Bit()) OffsetToRaw = toSection64(Sec)->FileOffsetToRawData; else OffsetToRaw = toSection32(Sec)->FileOffsetToRawData; Reviewers: Sean Fertile Subscribers: rupprecht, seiyai,hiraditya Differential Revision: https://reviews.llvm.org/D70255
* implement printing out raw section data of xcoff objectfile for llvm-objdumpdiggerlin2019-11-191-8/+17
| | | | | | | | | | | SUMMARY: implement printing out raw section data of xcoff objectfile for llvm-objdump and option -D --disassemble-all option for llvm-objdump Reviewers: Sean Fertile Subscribers: rupprecht, seiyai,hiraditya Differential Revision: https://reviews.llvm.org/D70255
* Revert "implement printing out raw section data of xcoff objectfile for ↵Leonard Chan2019-11-181-17/+8
| | | | | | | | llvm-objdump" This reverts commit 8f8a9f3437d4517f674395da30edb59d5514f7bc. Reverting since this patch seems to break a lot of llvm buildbots.
* implement printing out raw section data of xcoff objectfile for llvm-objdumpdiggerlin2019-11-181-8/+17
| | | | | | | | | | | SUMMARY: implement printing out raw section data of xcoff objectfile for llvm-objdump and option -D --disassemble-all option for llvm-objdump Reviewers: Sean Fertile Subscribers: rupprecht, seiyai,hiraditya Differential Revision: https://reviews.llvm.org/D70255
* Revert "[XCOFF] Fix link errors from explicit template instantiation"Reid Kleckner2019-11-071-4/+0
| | | | | | | | This reverts commit c989993ba1a666f04f7aee7df51d9f4de0588b71. maskray already fixed the explicit instantiation definition in the .cpp file, and these extern template declarations seem to be causing warnings that I don't understand.
* [XCOFF] Fix link errors from explicit template instantiationReid Kleckner2019-11-071-0/+4
| | | | | | | | | | | | | | | | I happen to be using clang-cl+lld-link locally, and I get these link errors: lld-link: error: undefined symbol: public: unsigned short __cdecl llvm::object::XCOFFSectionHeader<struct llvm::object::XCOFFSectionHeader64>::getSectionType(void) const >>> referenced by C:\src\llvm-project\llvm\tools\llvm-readobj\XCOFFDumper.cpp:106 >>> tools\llvm-readobj\CMakeFiles\llvm-readobj.dir\XCOFFDumper.cpp.obj:(public: virtual void __cdecl `anonymous namespace'::XCOFFDumper::printSectionHeaders(void)) I suspect this is because the explicit template instaniation appears before the inline method definitions in the .cpp file, so they aren't available at the point of instantiation. Move the explicit instantiation later. Also, forward declare the explicit instantiation for good measure.
* [XCOFF] Move explicit instantions after member function definitions to fix ↵Fangrui Song2019-11-071-4/+4
| | | | clang builds
* Using crtp to refactor the xcoff section headerdiggerlin2019-11-071-8/+19
| | | | | | | | | | | | | SUMMARY: According to https://reviews.llvm.org/D68575#inline-617586, Create a NFC patch for it. Using crtp to refactor the xcoff section header Move the define of SectionFlagsReservedMask and SectionFlagsTypeMask from XCOFFDumper.cpp to XCOFFObjectFile.h Reviewers: hubert.reinterpretcast,jasonliu Subscribers: rupprecht, seiyai,hiraditya Differential Revision: https://reviews.llvm.org/D69131
* [XCOFF]implement parsing relocation information for 32-bit xcoff object fileDigger Lin2019-10-151-4/+68
| | | | | | | | | | | | | | Summary: Parsing the relocation entry information for 32-bit xcoff object file including deal with the relocation overflow. Reviewers: hubert.reinterpretcast, jasonliu, sfertile, xingxue. Subscribers: hiraditya, rupprecht, seiya Differential Revision: https://reviews.llvm.org/D67008 llvm-svn: 374946
* revert git test commitDigger Lin2019-10-151-1/+1
| | | | llvm-svn: 374898
* a test commit accessDigger Lin2019-10-151-1/+1
| | | | llvm-svn: 374897
* [XCOFF][AIX] Generate symbol table entries with llvm-readobjJason Liu2019-08-271-20/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements main entry and auxiliary entries of symbol table generation for llvm-readobj on AIX. The source code of aix_xcoff_xlc_test8.o (compile with xlc) is: -bash-4.2$ cat test8.c extern int i; extern int TestforXcoff; extern int fun(int i); static int static_i; char* p="abcd"; int fun1(int j) { static_i++; j++; j=j+*p; return j; } int main() { i++; fun(i); return fun1(i); } Patch provided by DiggerLin Differential Revision: https://reviews.llvm.org/D65240 llvm-svn: 370097
* [llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-151-1/+1
| | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
* [XCOFF] Use a single symbolic constant for the size of an embeded name. [NFC]Sean Fertile2019-08-121-9/+9
| | | | | | | | | | Convert SymbolNameSize and SectionNameSize into just `NameSize`. The length of a name embeded in a symbol table entry or section header table entry is length 8 for Sections, Symbols and Files. No need to have a distinct constant for each one. Also removes the Size argument to 'generateStringRef' as the size is always 'XCOFF::NameSize'. llvm-svn: 368584
* [Object][XCOFF] Remove extra includes from XCOFF related files. [NFC]Sean Fertile2019-07-221-5/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D60885 llvm-svn: 366723
* Try to appease the Windows build bots.Sean Fertile2019-07-091-4/+12
| | | | | | | Several of the conditonal operators commited in llvm-svn: 365524 fail to compile on the windows buildbots. Converting to an if and early return to try to fix. llvm-svn: 365535
* [Object][XCOFF] Add support for 64-bit file header and section header dumping.Sean Fertile2019-07-091-149/+253
| | | | | | | | | | | Adds a readobj dumper for 32-bit and 64-bit section header tables, and extend support for the file-header dumping to include 64-bit object files. Also refactors the binary file parsing to be done in a helper function in an attempt to cleanup error handeling. Differential Revision: https://reviews.llvm.org/D63843 llvm-svn: 365524
* [XCOFF] Implement parsing symbol table for xcoffobjfile and output as yaml ↵Jason Liu2019-05-281-39/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | format Summary: This patch implement parsing symbol table for xcoffobjfile and output as yaml format. Parsing auxiliary entries of a symbol will be in a separate patch. The XCOFF object file (aix_xcoff.o) used in the test comes from -bash-4.2$ cat test.c extern int i; extern int TestforXcoff; int main() { i++; TestforXcoff--; } Patch by DiggerLin Reviewers: sfertile, hubert.reinterpretcast, MaskRay, daltenty Differential Revision: https://reviews.llvm.org/D61532 llvm-svn: 361832
* [Object] Change ObjectFile::getSectionContents to return ↵Fangrui Song2019-05-141-3/+2
| | | | | | | | | | | | | | | | | | | Expected<ArrayRef<uint8_t>> Change std::error_code getSectionContents(DataRefImpl, StringRef &) const; to Expected<ArrayRef<uint8_t>> getSectionContents(DataRefImpl) const; Many object formats use ArrayRef<uint8_t> as the underlying type, which is generally better than StringRef to represent binary data, so change the type to decrease the number of type conversions. Reviewed By: ruiu, sbc100 Differential Revision: https://reviews.llvm.org/D61781 llvm-svn: 360648
* [Object][XCOFF] Add an XCOFF dumper for llvm-readobj.Sean Fertile2019-05-031-7/+34
| | | | | | | | | | | Patch adds support for dumping of file headers with llvm-readobj. XCOFF object files are added to test dumping a well formed file, and dumping both negative timestamps and negative symbol counts, both of which are allowed in the XCOFF definition. Differential Revision: https://reviews.llvm.org/D60878 llvm-svn: 359878
* [Object] Change getSectionName() to return Expected<StringRef>Fangrui Song2019-05-021-5/+3
| | | | | | | | | | Summary: It currently receives an output parameter and returns std::error_code. Expected<StringRef> fits for this purpose perfectly. Differential Revision: https://reviews.llvm.org/D61421 llvm-svn: 359774
* [Object][XCOFF] Add intial support for section header table.Sean Fertile2019-04-251-29/+83
| | | | | | | | | Adds a representation of the section header table to XCOFFObjectFile, and implements enough to dump the section headers with llvm-obdump. Differential Revision: https://reviews.llvm.org/D60784 llvm-svn: 359244
* [XCOFF] Add functionality for parsing AIX XCOFF object file headersHubert Tong2019-04-041-0/+270
Summary: 1. Add functionality for parsing AIX XCOFF object files headers. 2. Only support 32-bit AIX XCOFF object files in this patch. 3. Print out the AIX XCOFF object file header in YAML format. Reviewers: sfertile, hubert.reinterpretcast, jasonliu, mstorsjo, zturner, rnk Reviewed By: sfertile, hubert.reinterpretcast Subscribers: jsji, mgorny, hiraditya, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59419 Patch by Digger Lin llvm-svn: 357663
OpenPOWER on IntegriCloud