#
09dcc6a5 |
| 18-Feb-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Fix PR18743.
The IR @foo = private constant i32 42
is valid, but before this patch we would produce an invalid MachO from it. It was invalid because it would use an L label in a section where the l
Fix PR18743.
The IR @foo = private constant i32 42
is valid, but before this patch we would produce an invalid MachO from it. It was invalid because it would use an L label in a section where the liker needs the labels in order to atomize it.
One way of fixing it would be to just reject this IR in the backend, but that would not be very front end friendly.
What this patch does is use an 'l' prefix in sections that we know the linker requires symbols for atomizing them. This allows frontends to just use private and not worry about which sections they go to or how the linker handles them.
One small issue with this strategy is that now a symbol name depends on the section, which is not available before codegen. This is not a problem in practice. The reason is that it only happens with private linkage, which will be ignored by the non codegen users (llvm-nm and llvm-ar).
llvm-svn: 201608
show more ...
|
#
1f3de49f |
| 13-Feb-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Use __literal16. It has been supported by the linker since 2005.
llvm-svn: 201365
|
#
15b26696 |
| 09-Feb-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Use a consistent argument order in TargetLoweringObjectFile.
These methods normally call each other and it is really annoying if the arguments are in different order. The more common rule was that t
Use a consistent argument order in TargetLoweringObjectFile.
These methods normally call each other and it is really annoying if the arguments are in different order. The more common rule was that the arguments specific to call are first (GV, Encoding, Suffix) and the auxiliary objects (Mang, TM) come after. This patch changes the exceptions.
llvm-svn: 201044
show more ...
|
#
fa0f7283 |
| 08-Feb-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Pass the Mangler by reference.
It is never null and it is not used in casts, so there is no reason to use a pointer. This matches how we pass TM.
llvm-svn: 201025
|
#
2037caf8 |
| 28-Jan-2014 |
Eric Christopher <echristo@gmail.com> |
Revert r199871 and replace it with a simple check in the debug info code to see if we're emitting a function into a non-default text section. This is still a less-than-ideal solution, but more contai
Revert r199871 and replace it with a simple check in the debug info code to see if we're emitting a function into a non-default text section. This is still a less-than-ideal solution, but more contained than r199871 to determine whether or not we're emitting code into an array of comdat sections.
llvm-svn: 200269
show more ...
|
#
15abef6d |
| 23-Jan-2014 |
Eric Christopher <echristo@gmail.com> |
Add a variable to track whether or not we've used a unique section, e.g. linkonce, to TargetMachine and set it when we've done so for ELF targets currently. This involved making TargetMachine non-con
Add a variable to track whether or not we've used a unique section, e.g. linkonce, to TargetMachine and set it when we've done so for ELF targets currently. This involved making TargetMachine non-const in a TLOF use and propagating that change around - I'm open to other ideas.
This will be used in a future commit to handle emitting debug information with ranges.
llvm-svn: 199871
show more ...
|
#
a88d7abe |
| 21-Jan-2014 |
Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> |
Adding new LTO APIs to parse metadata nodes and extract linker options and dependent libraries from a bitcode module.
Differential Revision: http://llvm-reviews.chandlerc.com/D2343
llvm-svn: 199759
|
#
894843cb |
| 07-Jan-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Move the llvm mangler to lib/IR.
This makes it available to tools that don't link with target (like llvm-ar).
llvm-svn: 198708
|
Revision tags: llvmorg-3.4.0, llvmorg-3.4.0-rc3, llvmorg-3.4.0-rc2 |
|
#
f4e6b29a |
| 02-Dec-2013 |
Rafael Espindola <rafael.espindola@gmail.com> |
Move getSymbolWithGlobalValueBase to TargetLoweringObjectFile.
This allows it to be used in TargetLoweringObjectFileImpl.cpp.
llvm-svn: 196117
|
#
3c8e147a |
| 27-Nov-2013 |
Rafael Espindola <rafael.espindola@gmail.com> |
Use the same tls section name as msvc.
We currently error in clang with: "error: thread-local storage is unsupported for the current target", but we can start to get the llvm level ready.
When comp
Use the same tls section name as msvc.
We currently error in clang with: "error: thread-local storage is unsupported for the current target", but we can start to get the llvm level ready.
When compiling
template<typename T> struct foo { static __declspec(thread) int bar; }; template<typename T> __declspec(therad) int foo<T>::bar; template struct foo<int>;
msvc produces
SECTION HEADER #3 .tls$ name 0 physical address 0 virtual address 4 size of raw data 12F file pointer to raw data (0000012F to 00000132) 0 file pointer to relocation table 0 file pointer to line numbers 0 number of relocations 0 number of line numbers C0301040 flags Initialized Data COMDAT; sym= "public: static int foo<int>::bar" (?bar@?$foo@H@@2HA) 4 byte align Read Write
gcc produces a ".data$__emutls_v.<symbol>" for the testcase with __declspec(thread) replaced with thread_local.
llvm-svn: 195849
show more ...
|
#
2d30ae2b |
| 27-Nov-2013 |
Rafael Espindola <rafael.espindola@gmail.com> |
Use simple section names for COMDAT sections on COFF.
With this patch we use simple names for COMDAT sections (like .text or .bss). This matches the MSVC behavior.
When merging it is the COMDAT sym
Use simple section names for COMDAT sections on COFF.
With this patch we use simple names for COMDAT sections (like .text or .bss). This matches the MSVC behavior.
When merging it is the COMDAT symbol that is used to decide if two sections should be merged, so there is no point in building a fancy name.
This survived a bootstrap on mingw32.
llvm-svn: 195798
show more ...
|
Revision tags: llvmorg-3.4.0-rc1 |
|
#
60ec3836 |
| 19-Nov-2013 |
Rafael Espindola <rafael.espindola@gmail.com> |
Support multiple COFF sections with the same name but different COMDAT.
This is the first step to fix pr17918.
It extends the .section directive a bit, inspired by what the ELF one looks like. The
Support multiple COFF sections with the same name but different COMDAT.
This is the first step to fix pr17918.
It extends the .section directive a bit, inspired by what the ELF one looks like. The problem with using linkonce is that given
.section foo .linkonce....
.section foo .linkonce
we would already have switched sections when getting to .linkonce. The cleanest solution seems to be to add the comdat information in the .section itself.
llvm-svn: 195148
show more ...
|
#
25b61dba |
| 17-Nov-2013 |
Bill Wendling <isanbard@gmail.com> |
Revert "Micro-optimization"
This reverts commit f1d9fe9d04ce93f6d5dcebbd2cb6a07414d7a029.
This was causing PR17964. We need to use thread data before regular data.
llvm-svn: 194960
|
#
e133ed88 |
| 29-Oct-2013 |
Rafael Espindola <rafael.espindola@gmail.com> |
Move getSymbol to TargetLoweringObjectFile.
This allows constructing a Mangler with just a TargetMachine.
llvm-svn: 193630
|
#
3d96acb7 |
| 13-Aug-2013 |
David Majnemer <david.majnemer@gmail.com> |
[-cxx-abi microsoft] Stick zero initialized symbols into the .bss section for COFF
Summary: We need to do two things:
- Initialize BSSSection in MCObjectFileInfo::InitCOFFMCObjectFileInfo - Teach T
[-cxx-abi microsoft] Stick zero initialized symbols into the .bss section for COFF
Summary: We need to do two things:
- Initialize BSSSection in MCObjectFileInfo::InitCOFFMCObjectFileInfo - Teach TargetLoweringObjectFileCOFF::SelectSectionForGlobal what to do with it
This fixes PR16861.
Reviewers: rnk
Reviewed By: rnk
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1361
llvm-svn: 188244
show more ...
|
#
c31c2de1 |
| 08-Aug-2013 |
Arnold Schwaighofer <aschwaighofer@apple.com> |
Revert "Reapply r185872 now that the address sanitizer has been changed to support this."
This reverts commit r187939. It broke an O0 build of a spec benchmark.
llvm-svn: 188012
|
#
f76d6b37 |
| 08-Aug-2013 |
David Majnemer <david.majnemer@gmail.com> |
Revert "coff also doesn't have a ReadOnlySection yet, (!)"
This reverts commit r77814.
We were sticking global constants in the .data section instead of in the .rdata section when emitting for COFF
Revert "coff also doesn't have a ReadOnlySection yet, (!)"
This reverts commit r77814.
We were sticking global constants in the .data section instead of in the .rdata section when emitting for COFF.
This fixes PR16831.
llvm-svn: 187956
show more ...
|
#
b80f9791 |
| 07-Aug-2013 |
Bill Wendling <isanbard@gmail.com> |
Reapply r185872 now that the address sanitizer has been changed to support this.
Original commit message:
Stop emitting weak symbols into the "coal" sections.
The Mach-O linker has been able to su
Reapply r185872 now that the address sanitizer has been changed to support this.
Original commit message:
Stop emitting weak symbols into the "coal" sections.
The Mach-O linker has been able to support the weak-def bit on any symbol for quite a while now. The compiler however continued to place these symbols into a "coal" section, which required the linker to map them back to the base section name.
Replace the sections like this:
__TEXT/__textcoal_nt instead use __TEXT/__text __TEXT/__const_coal instead use __TEXT/__const __DATA/__datacoal_nt instead use __DATA/__data
<rdar://problem/14265330>
llvm-svn: 187939
show more ...
|
#
7fdaee8f |
| 29-Jul-2013 |
Nico Rieck <nico.rieck@gmail.com> |
Use proper section suffix for COFF weak symbols
32-bit symbols have "_" as global prefix, but when forming the name of COMDAT sections this prefix is ignored. The current behavior assumes that this
Use proper section suffix for COFF weak symbols
32-bit symbols have "_" as global prefix, but when forming the name of COMDAT sections this prefix is ignored. The current behavior assumes that this prefix is always present which is not the case for 64-bit and names are truncated.
llvm-svn: 187356
show more ...
|
#
8d2d79d0 |
| 09-Jul-2013 |
Alexander Potapenko <glider@google.com> |
Revert r185872 - "Stop emitting weak symbols into the "coal" sections"
This patch broke `make check-asan` on Mac, causing ld warnings like the following one:
ld: warning: direct access in __GLOBAL_
Revert r185872 - "Stop emitting weak symbols into the "coal" sections"
This patch broke `make check-asan` on Mac, causing ld warnings like the following one:
ld: warning: direct access in __GLOBAL__I_a to global weak symbol ___asan_mapping_scale means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
The resulting test binaries crashed with incorrect ASan warnings.
llvm-svn: 185923
show more ...
|
#
0176708e |
| 08-Jul-2013 |
Bill Wendling <isanbard@gmail.com> |
Stop emitting weak symbols into the "coal" sections.
The Mach-O linker has been able to support the weak-def bit on any symbol for quite a while now. The compiler however continued to place these sy
Stop emitting weak symbols into the "coal" sections.
The Mach-O linker has been able to support the weak-def bit on any symbol for quite a while now. The compiler however continued to place these symbols into a "coal" section, which required the linker to map them back to the base section name.
Replace the sections like this:
__TEXT/__textcoal_nt instead use __TEXT/__text __TEXT/__const_coal instead use __TEXT/__const __DATA/__datacoal_nt instead use __DATA/__data
<rdar://problem/14265330>
llvm-svn: 185872
show more ...
|
Revision tags: llvmorg-3.3.1-rc1 |
|
#
a37acf70 |
| 06-Jul-2013 |
Nico Rieck <nico.rieck@gmail.com> |
MC: Implement COFF .linkonce directive
llvm-svn: 185753
|
#
1b01ae86 |
| 01-Jul-2013 |
David Blaikie <dblaikie@gmail.com> |
PR16493: DebugInfo with TLS on PPC crashing due to invalid relocation
Restrict the current TLS support to X86 ELF for now. Test that we don't produce it on PPC & we can flesh that test case out with
PR16493: DebugInfo with TLS on PPC crashing due to invalid relocation
Restrict the current TLS support to X86 ELF for now. Test that we don't produce it on PPC & we can flesh that test case out with the right thing once someone implements it.
llvm-svn: 185389
show more ...
|
#
f2694970 |
| 28-Jun-2013 |
David Blaikie <dblaikie@gmail.com> |
DebugInfo: PR14728: TLS support
Based on GCC's output for TLS variables (OP_constNu, x@dtpoff, OP_lo_user), this implements debug info support for TLS in ELF. Verified that this output is correct/su
DebugInfo: PR14728: TLS support
Based on GCC's output for TLS variables (OP_constNu, x@dtpoff, OP_lo_user), this implements debug info support for TLS in ELF. Verified that this output is correct/sufficient on Linux (using gold - if you're using binutils-ld, you'll need something with the fix for http://sourceware.org/bugzilla/show_bug.cgi?id=15685 in it).
Support on non-ELF is sort of "arbitrary" at the moment - if Apple folks want to discuss (or just go ahead & implement) how this should work in MachO, etc, I'm open.
llvm-svn: 185203
show more ...
|
Revision tags: llvmorg-3.3.0, llvmorg-3.3.0-rc3, llvmorg-3.3.0-rc2, llvmorg-3.3.0-rc1 |
|
#
55a9c97c |
| 26-Apr-2013 |
Bill Wendling <isanbard@gmail.com> |
Micro-optimization
TLVs probably won't be as common as the other types of variables. Check for them last before defaulting to "DATA".
llvm-svn: 180631
|