Bill Wendling
0569e9a6f3
Change the linker_private_weak_def_auto' linkage to
linkonce_odr_auto_hide' to
...
make it more consistent with its intended semantics.
The `linker_private_weak_def_auto' linkage type was meant to automatically hide
globals which never had their addresses taken. It has nothing to do with the
`linker_private' linkage type, which outputs the symbols with a `l' (ell) prefix
among other things.
The intended semantic is more like the `linkonce_odr' linkage type.
Change the name of the linkage type to `linkonce_odr_auto_hide'. And therefore
changing the semantics so that it produces the correct output for the linker.
Note: The old linkage name `linker_private_weak_def_auto' will still parse but
is not a synonym for `linkonce_odr_auto_hide'. This should be removed in 4.0.
<rdar://problem/11754934>
llvm-svn: 162114
2012-08-17 18:33:14 +00:00
Michael J. Spencer
4b672b2213
[llvm-nm] Update documentation to cover object file support and arguments.
...
llvm-svn: 158120
2012-06-06 23:34:10 +00:00
Benjamin Kramer
4e38a34add
Fix uses of the C99 PRI format macros not to conflict with C++11 UDLs.
...
llvm-svn: 152474
2012-03-10 02:04:38 +00:00
David Meyer
31e23de700
In the ObjectFile interface, replace isInternal(), isAbsolute(), isGlobal(), and isWeak(), with a bitset of flags.
...
llvm-svn: 151670
2012-02-28 23:47:53 +00:00
Michael J. Spencer
0aef1b9f18
[Object] Add {begin,end}_dynamic_symbols stubs and implementation for ELF.
...
Add -D option to llvm-nm to dump dynamic symbols.
Patch by David Meyer.
llvm-svn: 151600
2012-02-28 00:40:37 +00:00
Rafael Espindola
b598485fb9
Remove unused variables.
...
llvm-svn: 147261
2011-12-25 01:20:19 +00:00
Michael J. Spencer
02c5e58b03
llvm-nm: refactor in order to support reading files from stdin.
...
llvm-svn: 146524
2011-12-13 23:17:29 +00:00
Daniel Dunbar
30d6a45140
LLVMBuild: Remove trailing newline, which irked me.
...
llvm-svn: 146409
2011-12-12 19:48:00 +00:00
Danil Malyshev
5ce4e1a9d3
Fixed ObjectFile functions:
...
- getSymbolOffset() renamed as getSymbolFileOffset()
- getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile.
- added getRelocationOffset()
- fixed MachOObjectFile::getSymbolSize()
- fixed MachOObjectFile::getSymbolSection()
- fixed MachOObjectFile::getSymbolOffset() for symbols without section data.
llvm-svn: 145408
2011-11-29 17:40:10 +00:00
Chandler Carruth
e5e455c97f
Revert r145180 as it is causing test failures on all the bots.
...
Original commit message:
Fixed ObjectFile functions:
- getSymbolOffset() renamed as getSymbolFileOffset()
- getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile.
- added getRelocationOffset()
- fixed MachOObjectFile::getSymbolSize()
- fixed MachOObjectFile::getSymbolSection()
- fixed MachOObjectFile::getSymbolOffset() for symbols without section data.
llvm-svn: 145182
2011-11-27 10:37:47 +00:00
Danil Malyshev
3bbe062799
Fixed ObjectFile functions:
...
- getSymbolOffset() renamed as getSymbolFileOffset()
- getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile.
- added getRelocationOffset()
- fixed MachOObjectFile::getSymbolSize()
- fixed MachOObjectFile::getSymbolSection()
- fixed MachOObjectFile::getSymbolOffset() for symbols without section data.
llvm-svn: 145180
2011-11-27 10:12:52 +00:00
Daniel Dunbar
efa02a0c3d
LLVMBuild: Add description files for the LLVM tools.
...
llvm-svn: 144417
2011-11-11 22:59:39 +00:00
Stepan Dyatkovskiy
d1216f47ca
uint64 formatted output: replaced %llx with PRIx64 macro.
...
llvm-svn: 143191
2011-10-28 13:07:32 +00:00
Michael J. Spencer
2ec1e8e92f
llvm-nm: Use correct format string. Patch by Stepan Dyatkovskiy!
...
llvm-svn: 142984
2011-10-25 22:45:47 +00:00
Daniel Dunbar
81780d9982
build: Tidy up a bunch of tool Makefiles, and simplify where possible using the
...
new all-targets pseudo-component.
llvm-svn: 142401
2011-10-18 19:27:24 +00:00
Benjamin Kramer
357893ba6f
llvm-nm: Don't leak bitcode buffers.
...
llvm-svn: 141534
2011-10-10 13:10:04 +00:00
Michael J. Spencer
3cc26e4c5e
Fix GCC again.
...
llvm-svn: 141389
2011-10-07 19:46:12 +00:00
Michael J. Spencer
89e83b38cd
Add binary archive support to llvm-nm.
...
llvm-svn: 140627
2011-09-27 19:37:18 +00:00
Benjamin Kramer
52607b3842
Object: make the following changes into SymbolRef
...
- Add enum SymbolType and function getSymbolType()
- Add function isGlobal() - it's returns true for symbols that can be used in another objects, such as library functions.
- Rename function getAddress() to getOffset() and add new function getAddress(), because currently getAddress() returns section offset of symbol first byte. new getAddress() return symbol address.
- Change usage SymbolRef::getAddress() to getOffset() in tools/llvm-nm and tools/llvm-objdump.
Patch by Danil Malyshev!
llvm-svn: 139683
2011-09-14 01:22:52 +00:00
Michael J. Spencer
83e956656a
Object: Add proper error handling.
...
llvm-svn: 133872
2011-06-25 17:55:23 +00:00
Michael J. Spencer
0e64ab8463
Modify llvm-nm to use new Binary creation method.
...
llvm-svn: 133871
2011-06-25 17:54:59 +00:00
Michael J. Spencer
d5934fefee
Make Binary the parent of ObjectFile and update children to new interface.
...
llvm-svn: 133870
2011-06-25 17:54:50 +00:00
Michael J. Spencer
8288453980
Revert the last two commits in the series. r132911, r132912.
...
llvm-svn: 132913
2011-06-13 11:53:31 +00:00
Michael J. Spencer
c6fd5f05fc
Modify llvm-nm to use new Binary creation method.
...
llvm-svn: 132912
2011-06-13 11:12:42 +00:00
Michael J. Spencer
642af05937
Make Binary the parent of ObjectFile and update children to new interface.
...
llvm-svn: 132911
2011-06-13 11:12:33 +00:00
Michael J. Spencer
65584e095c
llvm-nm: Update to use the new LLVMObject library.
...
llvm-svn: 123897
2011-01-20 06:38:57 +00:00
Michael J. Spencer
86f6a9ac6e
MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
...
llvm-svn: 121958
2010-12-16 03:29:14 +00:00
Michael J. Spencer
15483143ec
Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
...
llvm-svn: 121379
2010-12-09 17:36:48 +00:00
Michael J. Spencer
d5ec932c3a
Merge System into Support.
...
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Michael J. Spencer
90f807fda5
Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
...
This reverts commit r113632
Conflicts:
cmake/modules/AddLLVM.cmake
llvm-svn: 113819
2010-09-13 23:59:48 +00:00
Michael J. Spencer
98ad3f2ea7
CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
...
llvm-svn: 113632
2010-09-10 21:14:25 +00:00
Michael J. Spencer
ab565264fa
Cleanup Whitespace.
...
llvm-svn: 112587
2010-08-31 06:36:46 +00:00
Bill Wendling
9e3d8d1a60
- Add the LinkerPrivateWeakDefAutoLinkage to the Ada bindings.
...
- Support the LinkerWeak*Linkage types in llvm-nm and in LinkModules.cpp.
llvm-svn: 111952
2010-08-24 20:00:52 +00:00
Bill Wendling
90b6422f2f
Implement the "linker_private_weak" linkage type. This will be used for
...
Objective-C metadata types which should be marked as "weak", but which the
linker will remove upon final linkage. However, this linkage isn't specific to
Objective-C.
For example, the "objc_msgSend_fixup_alloc" symbol is defined like this:
.globl l_objc_msgSend_fixup_alloc
.weak_definition l_objc_msgSend_fixup_alloc
.section __DATA, __objc_msgrefs, coalesced
.align 3
l_objc_msgSend_fixup_alloc:
.quad _objc_msgSend_fixup
.quad L_OBJC_METH_VAR_NAME_1
This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".
Currently only supported on Darwin platforms.
llvm-svn: 107433
2010-07-01 21:55:59 +00:00
Bill Wendling
59ef9bcc6d
Revert r107205 and r107207.
...
llvm-svn: 107215
2010-06-29 22:34:52 +00:00
Bill Wendling
05a4c0b1f2
Introducing the "linker_weak" linkage type. This will be used for Objective-C
...
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:
.globl l_objc_msgSend_fixup_alloc
.weak_definition l_objc_msgSend_fixup_alloc
.section __DATA, __objc_msgrefs, coalesced
.align 3
l_objc_msgSend_fixup_alloc:
.quad _objc_msgSend_fixup
.quad L_OBJC_METH_VAR_NAME_1
This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".
llvm-svn: 107205
2010-06-29 21:24:00 +00:00
Chris Lattner
5a57121631
make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
...
llvm-svn: 94378
2010-01-24 20:43:08 +00:00
Chris Lattner
276811b58a
Stop building RTTI information for *most* llvm libraries. Notable
...
missing ones are libsupport, libsystem and libvmcore. libvmcore is
currently blocked on bugpoint, which uses EH. Once it stops using
EH, we can switch it off.
This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.
llvm-svn: 94164
2010-01-22 06:49:46 +00:00
Nuno Lopes
a79196d2a9
fix leakage of Module
...
llvm-svn: 81445
2009-09-10 14:56:31 +00:00
Bill Wendling
1a10a060cb
Add plumbing for the `linker_private' linkage type. This type is meant for
...
"private" symbols which the assember shouldn't strip, but which the linker may
remove after evaluation. This is mostly useful for Objective-C metadata.
This is plumbing, so we don't have a use of it yet. More to come, etc.
llvm-svn: 76385
2009-07-20 01:03:30 +00:00
Dan Gohman
6abbc537f4
Convert more tools code from cerr and cout to errs() and outs().
...
llvm-svn: 76070
2009-07-16 15:30:09 +00:00
Owen Anderson
5c64fb5a80
To simplify the upcoming context-on-type change, switch all command line tools to using the default global context for now.
...
This will let us to hardwire stuff to the global context in the short term while the API is sorted out.
llvm-svn: 75846
2009-07-15 22:16:10 +00:00
Dan Gohman
60dce4c56b
Use errs() instead of std::cerr.
...
llvm-svn: 75791
2009-07-15 16:35:29 +00:00
Owen Anderson
cf112e59c3
Hold the LLVMContext by reference rather than by pointer.
...
llvm-svn: 74640
2009-07-01 21:22:36 +00:00
Owen Anderson
81b8dabb53
Add a pointer to the owning LLVMContext to Module. This requires threading LLVMContext through a lot
...
of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools.
Patches for Clang and LLVM-GCC to follow.
llvm-svn: 74614
2009-07-01 16:58:40 +00:00
Chris Lattner
c1bfdc9bb2
Add a new "available_externally" linkage type. This is intended
...
to support C99 inline, GNU extern inline, etc. Related bugzilla's
include PR3517, PR3100, & PR2933. Nothing uses this yet, but it
appears to work.
llvm-svn: 68940
2009-04-13 05:44:34 +00:00
Chris Lattner
1b05680d5f
Change various llvm utilities to use PrettyStackTraceProgram in
...
their main routines. This makes the tools print their argc/argv
commands if they crash.
llvm-svn: 66248
2009-03-06 05:34:10 +00:00
Chris Lattner
4869ed1aa7
disable exports from a bunch more tools, those without plugins.
...
llvm-svn: 65558
2009-02-26 19:01:11 +00:00
Rafael Espindola
0aba6c9435
Add the private linkage.
...
llvm-svn: 62279
2009-01-15 20:18:42 +00:00
Oscar Fuentes
0f25988689
Initial support for the CMake build system.
...
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Dale Johannesen
5da4b3ee8b
Add CommonLinkage to lto (treated same as weak AFAICT)
...
and llvm-nm (prints as C).
llvm-svn: 51209
2008-05-16 22:44:18 +00:00
Chris Lattner
309aeb140b
remove attributions from tools.
...
llvm-svn: 45421
2007-12-29 20:44:31 +00:00
Chris Lattner
11718ad357
remove attributions from tools/utils makefiles.
...
llvm-svn: 45414
2007-12-29 20:07:17 +00:00
Dan Gohman
2e8245a376
Move the space in overview output for commands out of each of the
...
commands and into the common code.
llvm-svn: 42752
2007-10-08 15:45:12 +00:00
Gabor Greif
5f705671e4
Here is the bulk of the sanitizing.
...
Almost all occurrences of "bytecode" in the sources have been eliminated.
llvm-svn: 37913
2007-07-05 17:07:56 +00:00
Lauro Ramos Venancio
aed8d1f617
llvm-nm must print the alias symbols.
...
llvm-svn: 37766
2007-06-27 22:08:09 +00:00
Chris Lattner
e24a5def42
use the new MemoryBuffer interfaces to simplify error reporting in clients.
...
llvm-svn: 36900
2007-05-06 23:45:49 +00:00
Chris Lattner
5947ecbfbf
switch tools to bitcode instead of bytecode
...
llvm-svn: 36868
2007-05-06 09:29:57 +00:00
Chris Lattner
9233c279e4
add bitcode reading support to llvm-nm
...
llvm-svn: 36847
2007-05-06 05:36:18 +00:00
Reid Spencer
686756b11e
Remove some non-sensical logic that prevented llvm-nm from working on any
...
file other than one named "-".
llvm-svn: 35478
2007-03-29 19:49:07 +00:00
Jeff Cohen
98c99a3a02
Unbreak VC++ build.
...
llvm-svn: 34917
2007-03-05 00:00:42 +00:00
Chris Lattner
43d0b955a3
push bytecode decompressor out through APIs. Now the bytecode reader
...
api's look like this:
ModuleProvider *getBytecodeModuleProvider(
const std::string &Filename, ///< Name of file to be read
BCDecompressor_t *BCDC = Compressor::decompressToNewBuffer,
std::string* ErrMsg = 0, ///< Optional error message holder
BytecodeHandler* H = 0 ///< Optional handler for reader events
);
This is ugly, but allows a client to say:
getBytecodeModuleProvider("foo", 0);
If they do this, there is no dependency on the compression libraries, saving
codesize.
llvm-svn: 34012
2007-02-07 21:41:02 +00:00
Reid Spencer
19af04a142
For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
...
confusion with external linkage types.
llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Chris Lattner
41c5ddb8cb
make all llvm tools call llvm_shutdown when they exit, static'ify some stuff.
...
With this change, I can now move -stats to print when llvm_shutdown is called.
llvm-svn: 32250
2006-12-06 01:18:01 +00:00
Chris Lattner
2da81d7d76
Use LINK_COMPONENTS to specify *components* to link against instead of
...
using USED_LIBS to specify *libraries* to link against.
llvm-svn: 30090
2006-09-04 05:59:09 +00:00
Chris Lattner
bbcb37f911
no need to check readability here
...
llvm-svn: 29449
2006-08-01 18:22:21 +00:00
Reid Spencer
cb66ae964e
Finish removal of EH usage from the Archive library. The REQUIRES_EH flag
...
in lib/Bytecode/Archive/Makefile is now removed. One small step closer to
a smaller LLVM.
llvm-svn: 29067
2006-07-07 20:56:50 +00:00
Chris Lattner
9f5a13c5c0
Tools require EH for their top-level try blocks.
...
llvm-svn: 29035
2006-07-07 00:46:19 +00:00
Reid Spencer
94a443bb29
Use archive libraries instead of object files for VMCore, BCReader,
...
BCWriter, and bzip2 libraries. Adjust the various makefiles to accommodate
these changes. This was done to speed up link times.
llvm-svn: 28610
2006-06-01 01:30:27 +00:00
Chris Lattner
f604017e47
Patches to make the LLVM sources more -pedantic clean. Patch provided
...
by Anton Korobeynikov! This is a step towards closing PR786.
llvm-svn: 28447
2006-05-24 17:04:05 +00:00
Reid Spencer
fb7bca6fa6
For PR495:
...
Change interface to Path class:
readable -> canRead
writable -> canWrite
executable -> canExecute
More (incremental) changes coming to close 495.
llvm-svn: 22345
2005-07-07 18:21:42 +00:00
Misha Brukman
960a8d47d7
Remove trailing whitespace
...
llvm-svn: 21428
2005-04-22 00:00:37 +00:00
Chris Lattner
6ad326ee0b
method renamed
...
llvm-svn: 20616
2005-03-15 15:48:22 +00:00
Reid Spencer
298f85282c
For PR351:
...
* Place a try/catch block around the entire tool to Make sure std::string
exceptions are caught and printed before exiting the tool.
* Make sure we catch unhandled exceptions at the top level so that we don't
abort with a useless message but indicate than an unhandled exception was
generated.
llvm-svn: 19192
2004-12-30 05:36:08 +00:00
Reid Spencer
6ccc7d8dab
For PR351:
...
Remove #inclusion of Support/FileUtilities.h which isn't needed any more.
llvm-svn: 18950
2004-12-15 01:53:50 +00:00
Reid Spencer
8563fa6493
PR351: \
...
Use sys::Path not FileUtilities to check file types
llvm-svn: 18865
2004-12-13 03:01:26 +00:00
Reid Spencer
b79950be4d
Add LLVMbzip2 library, now required.
...
llvm-svn: 18255
2004-11-25 20:22:06 +00:00
Reid Spencer
37c081cfb6
*Fix usage of changed function prototype*Use Archive interface to symbol table for archives
...
llvm-svn: 17795
2004-11-14 22:27:46 +00:00
Reid Spencer
7cd9ae667f
This tool needs libLLVMArchive now
...
llvm-svn: 17794
2004-11-14 22:27:00 +00:00
Reid Spencer
d3f7233495
Change Library Names Not To Conflict With Others When Installed
...
llvm-svn: 17286
2004-10-27 23:18:45 +00:00
Reid Spencer
5574857063
We're not doing automake any more
...
llvm-svn: 17168
2004-10-22 21:02:23 +00:00
Reid Spencer
e48ba34fd4
We won't use automake
...
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Reid Spencer
ce514b1c2c
Initial automake generated Makefile template
...
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Reid Spencer
e6418ec30f
Update to reflect changes in Makefile rules.
...
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Reid Spencer
817a069ea4
Initial version of automake Makefile.am file.
...
llvm-svn: 16894
2004-10-10 22:36:40 +00:00
Reid Spencer
c4abcbefb1
Changes For Bug 352
...
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.
llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Reid Spencer
e044a2172e
Add the LLVMsystem.a library as it is now used for operating system
...
independence of the tool.
llvm-svn: 16092
2004-08-29 19:29:38 +00:00
Reid Spencer
8cb2484800
The functions in Signal.h are now in the llvm::sys namespace - adjust
...
llvm-svn: 16091
2004-08-29 19:28:55 +00:00
Chris Lattner
9b03d18729
IA64 compat
...
llvm-svn: 14867
2004-07-16 00:08:28 +00:00
Reid Spencer
6d8b0985d1
Add #include <iostream> since Value.h does not include it any more.
...
llvm-svn: 14623
2004-07-04 12:20:55 +00:00
Chris Lattner
6f0bab5b9d
Header file moved
...
llvm-svn: 13813
2004-05-27 05:41:36 +00:00
Alkis Evlogimenos
904f4f9a21
Include cerrno (gcc-3.4 fix)
...
llvm-svn: 13091
2004-04-21 16:11:40 +00:00
Chris Lattner
f8c22e360b
Make sure to print a stack trace whenever an error signal is delivered to the
...
tool.
llvm-svn: 11632
2004-02-19 20:32:12 +00:00
Brian Gaeke
f67fef08c2
Unbreak the "-" as filename hack.
...
llvm-svn: 10099
2003-11-19 22:15:00 +00:00
Brian Gaeke
6669b6c511
Also print an error msg. for files we cannot currently deal with.
...
llvm-svn: 10097
2003-11-19 21:57:30 +00:00
Brian Gaeke
1b0a946551
Fix PR134, by checking FileOpenable() on each input file before analyzing its
...
type.
llvm-svn: 10096
2003-11-19 21:52:09 +00:00
Brian Gaeke
570e50fc30
Include Support/FileUtilities.h.
...
Print module identifier in DumpSymbolNamesFromModule().
In DumpSymbolNamesFromFile(), check whether it is an archive or a bytecode
file, and call the corresponding reader function (ParseBytecodeFile or
ReadArchiveFile).
Unconditionally set MultipleFiles for archives.
Fixes PR117.
llvm-svn: 10044
2003-11-16 23:34:13 +00:00
Brian Gaeke
d25f86d683
Put all LLVM code into the llvm namespace, as per bug 109.
...
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner
f7585e10cf
Reorder #includes, drop unneeded one
...
llvm-svn: 9548
2003-10-28 19:08:15 +00:00
John Criswell
a8dfda0513
Added LLVM copyright to Makefiles.
...
llvm-svn: 9314
2003-10-20 22:29:16 +00:00
Chris Lattner
34a5a4c718
fix file header
...
llvm-svn: 9294
2003-10-20 17:58:43 +00:00
John Criswell
d06dc1136b
Added copyright header to all C++ source files.
...
llvm-svn: 9291
2003-10-20 17:47:21 +00:00
Chris Lattner
2c93d183ac
Make llvm-nm work in "pipe mode"
...
llvm-svn: 9172
2003-10-16 18:45:23 +00:00
Chris Lattner
d7e4cc9339
Geeze, what is with Brian and these ifdef's?
...
llvm-svn: 9169
2003-10-16 18:27:24 +00:00
Brian Gaeke
d7f07a7f91
Okay, this is a little hack that "scratches an itch" of mine.
...
I dislike having to examine the output of "dis" to see what symbols
are in a bytecode file. So, here is a first cut at a "nm" utility for llvm.
Flame away.... :-)
llvm-svn: 9153
2003-10-16 04:43:15 +00:00