summaryrefslogtreecommitdiff
path: root/tools/gold/gold-plugin.cpp
Commit message (Collapse)AuthorAge
* use 64-bit types instead of off_t/size_t to avoid the issue whenIvan Krasin2011-09-15
| | | | | | | | | | gold plugin is built with Large File Support (sizeof(off_t) == 64 on i686) and the rest of LLVM is built w/o Large File Support (sizeof(off_t) == 32 on i686) which corrupts the stack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139873 91177308-0d34-0410-b5e6-96231b3b80d8
* gold plugin: don't report error on non-bitcode (e.g. ELF) files.Ivan Krasin2011-09-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139544 91177308-0d34-0410-b5e6-96231b3b80d8
* gold plugin: report errors occured in lto_module_create_from_*Ivan Krasin2011-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139340 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't try to dereference syms[0] on an empty vector. Reported by Todd JacksonNick Lewycky2011-07-26
| | | | | | | and Jeffrey Bosboom! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136066 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unused variable.Duncan Sands2011-05-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130860 91177308-0d34-0410-b5e6-96231b3b80d8
* If present, use gold's support for getting a file view. This prevents havingRafael Espindola2011-04-07
| | | | | | to map the file both in the linker and in the plugin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129109 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a lto_codegen_compile_to_file to avoid producing a file, reading it toRafael Espindola2011-03-22
| | | | | | memory and writing it back to disk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128108 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support in the LTO library for loading an object from the middleRafael Espindola2011-03-17
| | | | | | of an file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127781 91177308-0d34-0410-b5e6-96231b3b80d8
* Gold now rescans archives as needed, so the pass-through options are notRafael Espindola2011-02-27
| | | | | | necessary anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126580 91177308-0d34-0410-b5e6-96231b3b80d8
* bfd was fixed, remove the work around.Rafael Espindola2011-02-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126579 91177308-0d34-0410-b5e6-96231b3b80d8
* LTO uses MC now.Rafael Espindola2011-02-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126546 91177308-0d34-0410-b5e6-96231b3b80d8
* Dispose modules early and only create codegen when the plugin is beingRafael Espindola2011-02-20
| | | | | | used by the linker and not by nm or ar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126089 91177308-0d34-0410-b5e6-96231b3b80d8
* Add modules to codegen as soon as possible. This reduces the link timeRafael Espindola2011-02-19
| | | | | | of libxul from 12m31.084s to 7m1.359s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126052 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a debug obj-path option to make it easy to keep the .o produce by LTO.Rafael Espindola2011-02-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125663 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch llvm to using comdats. For now always use groups with a singleRafael Espindola2011-02-14
| | | | | | section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125526 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't open the file again in the gold plugin. To be able to do this, updateRafael Espindola2011-02-08
| | | | | | MemoryBuffer::getOpenFile to not close the file descriptor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125128 91177308-0d34-0410-b5e6-96231b3b80d8
* gold: MinGW fix.Michael J. Spencer2011-01-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123886 91177308-0d34-0410-b5e6-96231b3b80d8
* I swear I did a make clean and make before committing all this...Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120304 91177308-0d34-0410-b5e6-96231b3b80d8
* Move tool_output_file into its own file.Dan Gohman2010-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115973 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix compile errors.Nick Lewycky2010-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112808 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert tools to use tool_output_file, and introduce errorDan Gohman2010-08-20
| | | | | | | checking to places which previously lacked it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111651 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to set the cpu used for codegen.Rafael Espindola2010-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110759 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to set the flags passed to the assembler.Rafael Espindola2010-08-10
| | | | | | Nick, please review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110705 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix silly bug.Rafael Espindola2010-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110684 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to set the target triple and expose that with an option in theRafael Espindola2010-08-09
| | | | | | gold plugin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110604 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove variables that are written by not read.Duncan Sands2010-06-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107126 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an extra-library-path option to the plugin. This is used to supportRafael Espindola2010-06-23
| | | | | | | | | | | | having a library both as bitcode and native code. We want to use the bitcode first, but if codegen produces new undefined references we have to use the native code to satisfy those references. Gold has no notion of bitcode and native search directories, so instead it has an API where the plugin can instruct it to look for the libraries it is passing to it. This patch uses that API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106674 91177308-0d34-0410-b5e6-96231b3b80d8
* add_input_file and add_input_library now take const arguments, remove theRafael Espindola2010-06-21
| | | | | | const_cast. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106410 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a pass-through option to the plugin. The use case for this option is toRafael Espindola2010-06-18
| | | | | | | | ask the linker to take another look into some library or object. The case when one might want to do this is when codegen introduces a new undefined reference. The canonical example is libgcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106303 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't produce output only if *all* files are unused.Rafael Espindola2010-06-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105962 91177308-0d34-0410-b5e6-96231b3b80d8
* Plug a leak in the non-error case by removing one level of indirection.Nick Lewycky2010-06-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105556 91177308-0d34-0410-b5e6-96231b3b80d8
* Misc cleanups to the gold plugin.Rafael Espindola2010-06-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105534 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a emit-llvm option to the plugin and make the path argument to ↵Rafael Espindola2010-06-03
| | | | | | also-emit-llvm optional. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105414 91177308-0d34-0410-b5e6-96231b3b80d8
* Perfer !string.empty() over string != "".Nick Lewycky2010-06-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105397 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace cleanup.Nick Lewycky2010-06-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105395 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't preserve all symbols in a .so and instead trust gold to know what isRafael Espindola2010-06-03
| | | | | | | needed. The result is that now we are able to drop unnecessary symbol from shared libraries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105389 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an also-emit-llvm option to the gold plugin.Rafael Espindola2010-05-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103714 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r64616 which worked around http://gcc.gnu.org/PR42757 , we just didn'tNick Lewycky2010-04-16
| | | | | | | know it at the time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101439 91177308-0d34-0410-b5e6-96231b3b80d8
* Make things static that don't need to be referenced from outside the file.Dan Gohman2010-04-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101430 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix to pass options from Gold plugin to LTO codegenViktor Kutuzov2009-10-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85419 91177308-0d34-0410-b5e6-96231b3b80d8
* Include config.h in order to have HAVE_STDINT_H be defined.Duncan Sands2009-10-22
| | | | | | | | In the latest binutils the plugin-api.h needs this - without it the LLVM gold plugin fails to compile. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84861 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LLVM command-line tools overwrite their output files without -f.Dan Gohman2009-08-25
| | | | | | | | | | | | | | | | | This is conventional command-line tool behavior. -f now just means "enable binary output on terminals". Add a -f option to llvm-extract and llvm-link, for consistency. Remove F_Force from raw_fd_ostream and enable overwriting and truncating by default. Introduce an F_Excl flag to permit users to enable a failure when the file already exists. This flag is currently unused. Update Makefiles and documentation accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79990 91177308-0d34-0410-b5e6-96231b3b80d8
* Change raw_fd_ostream to take flags as an optional bitmask Chris Lattner2009-08-23
| | | | | | | | | | | | | | | | | | | instead of as two bools. Use this to add a F_Append flag which has the obvious behavior. Other unrelated changes conflated into this patch: 1. REmove EH stuff from llvm-dis and llvm-as, the try blocks are dead. 2. Simplify the filename inference code in llvm-as/llvm-dis, because raw_fd_ostream does the right thing with '-'. 3. Switch machine verifier to use raw_ostream instead of ostream (Which is the thing that needed append in the first place). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79807 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a Force option to raw_fd_ostream to specify whether openingDan Gohman2009-07-15
| | | | | | | | | an existing file is considered an error. Convert several tools to use raw_fd_ostream instead of std::ostream, and to use this new option instead of doing a manual check. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75801 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a portable strerror*() wrapper, llvm::sys::StrError(). This includes theJeffrey Yasskin2009-07-01
| | | | | | | | | Windows variant, strerror_s, but I couldn't test that. I'll update configure and config.h.in in a subsequent patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74621 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the gcc= option. llvm-gcc uses only as=Rafael Espindola2009-06-15
| | | | | | | | | | Look for as in the path. Doing it here instead of llvm-gcc because llvm-gcc has nothing as convenient as sys::Program::FindProgramByName. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73383 91177308-0d34-0410-b5e6-96231b3b80d8
* Add option for specifying the path to assembler, "as". This overrides the pathNick Lewycky2009-06-07
| | | | | | | to gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73008 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow a user of libLTO to specify the full pathname of the gcc executable toNick Lewycky2009-04-30
| | | | | | | | | | run when assembling. Wire this up to the gold plugin. You can now pass --plugin-opt gcc=/foo/bar/gcc and it will run that gcc instead of looking for it on the path. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70490 91177308-0d34-0410-b5e6-96231b3b80d8
* Add LTO_SYMBOL_DEFINITION_WEAKUNDEF, use that on the gold plugin.Rafael Espindola2009-04-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69972 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an option to the gold plugin to make it emit a file with the public apiNick Lewycky2009-02-22
| | | | | | | | | | | list that can in turn be passed to -internalize pass through -internalize-public-api-file. Pass gold -plugin-opt=generate-api-file to produce "apifile.txt" in the current directory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65295 91177308-0d34-0410-b5e6-96231b3b80d8