summaryrefslogtreecommitdiff
path: root/tools/gold/gold-plugin.cpp
Commit message (Collapse)AuthorAge
* Fix the build with gcc 4.7 and -std=c++11.Rafael Espindola2013-06-17
| | | | | | | | | | | The error message was: /home/espindola/llvm/llvm/tools/gold/gold-plugin.cpp: In function ‘ld_plugin_status cleanup_hook()’: /home/espindola/llvm/llvm/tools/gold/gold-plugin.cpp:461:30: error: cannot pass objects of non-trivially-copyable type ‘std::string {aka class std::basic_string<char>}’ through ‘...’ I will check if this was a clang or gcc issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184138 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PathV1.h in tools/gold/gold-plugin.cpp.Rafael Espindola2013-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184099 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid using PathV1.h in Program.h.Rafael Espindola2013-06-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183940 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort the #include lines for tools/...Chandler Carruth2012-12-04
| | | | | | | | Again, tools are trickier to pick the main module header for than library source files. I've started to follow the pattern of using LLVMContext.h when it is included as a stub for program source files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169252 91177308-0d34-0410-b5e6-96231b3b80d8
* libLTO has a bug in that it will keep every symbol if none is needed. We usedRafael Espindola2012-10-26
| | | | | | | | | | to hack around this in the gold plugin by deleting a module if no symbol was needed. Unfortunately, the hack is wrong in the case of o module having no visible symbols but still having side effects via static constructors. The bug will have to be fixed in libLTO itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166745 91177308-0d34-0410-b5e6-96231b3b80d8
* Use LTO_CODEGEN_PIC_MODEL_DYNAMIC for PIE. This requirest a git version ofRafael Espindola2012-06-13
| | | | | | | | gold to work. Since the enum value LDPO_PIE has just been added to plugin-api.h, use a numeric constant for now so that we don't require an unreleased version of gold to build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158402 91177308-0d34-0410-b5e6-96231b3b80d8
* drop unneeded config.h includesDylan Noblesmith2011-12-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147197 91177308-0d34-0410-b5e6-96231b3b80d8
* 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