summaryrefslogtreecommitdiffstats
path: root/llvm/tools/yaml2obj/yaml2obj.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Define InitLLVM to do common initialization all at once.Rui Ueyama2018-04-131-6/+2
| | | | | | | | | | | We have a few functions that virtually all command wants to run on process startup/shutdown. This patch adds InitLLVM class to do that all at once, so that we don't need to copy-n-paste boilerplate code to each llvm command's main() function. Differential Revision: https://reviews.llvm.org/D45602 llvm-svn: 330046
* Avoid int to string conversion in Twine or raw_ostream contexts.Benjamin Kramer2017-12-281-1/+1
| | | | | | Some output changes from uppercase hex to lowercase hex, no other functionality change intended. llvm-svn: 321526
* [Support] Rename tool_output_file to ToolOutputFile, NFCReid Kleckner2017-09-231-2/+2
| | | | | | | This class isn't similar to anything from the STL, so it shouldn't use the STL naming conventions. llvm-svn: 314050
* Try to fix uninitialized read reported by msan.Zachary Turner2017-06-151-0/+1
| | | | llvm-svn: 305528
* [yaml2obj] Factor out error handling code.Davide Italiano2017-04-051-15/+12
| | | | llvm-svn: 299551
* [yaml2obj] Improve error message when output file cannot be opened.Davide Italiano2017-04-051-1/+2
| | | | | | | | Patch by Sam Clegg! Differential Revision: https://reviews.llvm.org/D31351 llvm-svn: 299546
* [WebAssembly] Improve support for WebAssembly binary formatDerek Schuff2017-03-301-0/+2
| | | | | | | | | | | | | | | | | | | Mostly this change adds support converting to and from YAML which will allow us to write more test cases for the WebAssembly MC and lld ports. Better support for objdump, readelf, and nm will be in followup CLs. I had to update the two wasm test binaries because they used the old style 'name' section which is no longer supported. Differential Revision: https://reviews.llvm.org/D31099 Patch by Sam Clegg llvm-svn: 299101
* [yaml2obj] Remove --format option in favor of YAML tagsChris Bieneman2016-06-271-42/+20
| | | | | | | | | | | | | | | | | | | | | | Summary: Our YAML library's handling of tags isn't perfect, but it is good enough to get rid of the need for the --format argument to yaml2obj. This patch does exactly that. Instead of requiring --format, it infers the format based on the tags found in the object file. The supported tags are: !ELF !COFF !mach-o !fat-mach-o I have a corresponding patch that is quite large that fixes up all the in-tree test cases. Reviewers: rafael, Bigcheese, compnerd, silvas Subscribers: compnerd, llvm-commits Differential Revision: http://reviews.llvm.org/D21711 llvm-svn: 273915
* Search for llvm-symbolizer binary in the same directory as argv[0], beforeRichard Smith2016-06-091-1/+1
| | | | | | | looking for it along $PATH. This allows installs of LLVM tools outside of $PATH to find the symbolizer and produce pretty backtraces if they crash. llvm-svn: 272232
* Initial add for MachO support for yaml2objChris Bieneman2016-05-111-1/+5
| | | | | | | | Adding the initial files for adding MachO support to yaml2obj. Passing a MachO file will result in an error. I will be implementing obj2yaml and yaml2obj for MachO in parallel so that one can be used to test the other. llvm-svn: 269244
* Make helper functions static.Benjamin Kramer2015-03-091-1/+2
| | | | | | Found by -Wmissing-prototypes. NFC. llvm-svn: 231664
* Modernize raw_fd_ostream's constructor a bit.Rafael Espindola2014-08-251-4/+4
| | | | | | | | | | Take a StringRef instead of a "const char *". Take a "std::error_code &" instead of a "std::string &" for error. A create static method would be even better, but this patch is already a bit too big. llvm-svn: 216393
* Update the MemoryBuffer API to use ErrorOr.Rafael Espindola2014-07-061-3/+4
| | | | llvm-svn: 212405
* Remove system_error.h.Rafael Espindola2014-06-121-2/+2
| | | | | | | This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch. llvm-svn: 210803
* [yaml2obj] Add new command line option `-docnum`.Simon Atanasyan2014-05-311-4/+29
| | | | | | | | | | Input YAML file might contain multiple object file definitions. New option `-docnum` allows to specify an ordinal number (starting from 1) of definition used for an object file generation. Patch reviewed by Sean Silva. llvm-svn: 209967
* [yaml2obj] Add "-o" command line option to specify an output file name.Simon Atanasyan2014-05-151-7/+27
| | | | llvm-svn: 208900
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-2/+1
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* [yaml2obj] Initial ELF support.Sean Silva2013-06-101-1/+5
| | | | | | | | | Currently, only emitting the ELF header is supported (no sections or segments). The ELFYAML code organization is broadly similar to the COFFYAML code. llvm-svn: 183711
* yaml2obj: split out COFF logic into separate fileSean Silva2013-06-051-287/+2
| | | | llvm-svn: 183335
* yaml2obj: add -format=<fmt> to choose input YAML interpretationSean Silva2013-06-051-11/+39
| | | | | | | | | | | | See the comment in yaml2obj.cpp for why this is currently needed. Eventually we can get rid of this, but for now it is needed in order to make forward progress with adding ELF support, and should be straightforward to remove later. Also, preserve the default of COFF, to avoid breaking existing tests. This policy can easily be changed later though. llvm-svn: 183332
* Rename COFFYaml.h to COFFYAML.h for consistency.Rafael Espindola2013-05-311-1/+1
| | | | llvm-svn: 183042
* Don't allocate temporary string for section data.Rafael Espindola2013-05-311-7/+10
| | | | llvm-svn: 183040
* Convert obj2yaml to use yamlio.Rafael Espindola2013-05-171-360/+1
| | | | llvm-svn: 182169
* Split Alignment out of the Section Characteristics.Rafael Espindola2013-05-061-14/+4
| | | | | | | | The alignment is just a byte in the middle of Characteristics, not an independent flag. Making it an independent field in the yaml representation makes it more yamlio friendly. llvm-svn: 181243
* Don't compute a std::vector<uint8_t> just to write it out a stream.Rafael Espindola2013-04-251-83/+17
| | | | llvm-svn: 180247
* Fix typo.Rafael Espindola2013-04-231-7/+7
| | | | llvm-svn: 180137
* Simplify yaml2obj a bit.Rafael Espindola2013-04-231-105/+112
| | | | | | | | | | | | The COFFParser now contains only a COFFYAML::Object and the string table (which is recomputed, not serialized). The structs in COFFParser now all begin with a Header field with what is actually on the COFF object. The other fields are things that are semantically part of the struct (relocations in a section for exmaple), but are not actually represented that way in the object file. llvm-svn: 180134
* Write relocations in yaml2obj.Rafael Espindola2013-04-231-0/+13
| | | | llvm-svn: 180115
* Remove COFFYAML::Header.Rafael Espindola2013-04-201-17/+38
| | | | | | | Instead, use MappingNormalization to directly parse COFF::header. Also change the naming convention of the helper classes to be a bit shorter. llvm-svn: 179917
* Remove COFFYAML::Relocation.Rafael Espindola2013-04-191-11/+19
| | | | | | | | Use MappingNormalization to read a COFF::relocation directly. No functionality change. llvm-svn: 179891
* Move yaml2obj to tools too.Rafael Espindola2013-04-051-0/+707
llvm-svn: 178904
OpenPOWER on IntegriCloud