1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

50 Commits

Author SHA1 Message Date
Rafael Espindola
8dcab00115 Remove unused flag.
llvm-svn: 193752
2013-10-31 15:49:39 +00:00
Benjamin Kramer
f7e00de5d0 Fix alignment of .comm and .lcomm on mingw32.
For some reason .lcomm uses byte alignment and .comm log2 alignment so we can't
use the same setting for both. Fix this by reintroducing the LCOMM enum.
I verified this against mingw's gcc.

llvm-svn: 163420
2012-09-07 21:08:01 +00:00
Benjamin Kramer
f7fdee3ce3 MC: Overhaul handling of .lcomm
- Darwin lied about not supporting .lcomm and turned it into zerofill in the
  asm parser. Push the zerofill-conversion down into macho-specific code.
- This makes the tri-state LCOMMType enum superfluous, there are no targets
  without .lcomm.
- Do proper error reporting when trying to use .lcomm with alignment on a target
  that doesn't support it.
- .comm and .lcomm alignment was parsed in bytes on COFF, should be power of 2.
- Fixes PR13755 (.lcomm crashes on ELF).

llvm-svn: 163395
2012-09-07 17:25:13 +00:00
Rafael Espindola
0280a5d85b Remove another duplicated variable. We only need one to tell us if the linker
knows dwarf or not.

llvm-svn: 158993
2012-06-22 13:32:49 +00:00
Rafael Espindola
13084dd6a3 Fix a FIXME: DwarfRequiresRelocationForSectionOffset is the same as
DwarfUsesRelocationsAcrossSections.

llvm-svn: 158992
2012-06-22 13:24:07 +00:00
Nick Lewycky
da52706728 Emit relocations for DW_AT_location entries on systems which need it. This is
a recommit of r127757. Fixes PR9493. Patch by Paul Robinson!

llvm-svn: 158957
2012-06-22 01:25:12 +00:00
Jim Grosbach
343a996ca5 Refactor data-in-code annotations.
Use a dedicated MachO load command to annotate data-in-code regions.
This is the same format the linker produces for final executable images,
allowing consistency of representation and use of introspection tools
for both object and executable files.

Data-in-code regions are annotated via ".data_region"/".end_data_region"
directive pairs, with an optional region type.

data_region_directive := ".data_region" { region_type }
region_type := "jt8" | "jt16" | "jt32" | "jta32"
end_data_region_directive := ".end_data_region"

The previous handling of ARM-style "$d.*" labels was broken and has
been removed. Specifically, it didn't handle ARM vs. Thumb mode when
marking the end of the section.

rdar://11459456

llvm-svn: 157062
2012-05-18 19:12:01 +00:00
Jim Grosbach
289783c78d Tidy up. Trailing whitespace.
llvm-svn: 156602
2012-05-11 01:41:30 +00:00
David Blaikie
576aba04f1 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
llvm-svn: 146960
2011-12-20 02:50:00 +00:00
Anton Korobeynikov
e2277de6a7 Emit the ctors in the proper order on ARM/EABI.
Maybe some targets should use this as well.

Patch by Evgeniy Stepanov!

llvm-svn: 145781
2011-12-03 23:49:37 +00:00
Bill Wendling
d26e0c541c MachO doesn't support the protected visibility. Don't default to 'global' here. <rdar://problem/10396775>
llvm-svn: 145368
2011-11-29 02:39:58 +00:00
Nick Lewycky
651475977d Teach our Dwarf emission to use the string pool.
llvm-svn: 143097
2011-10-27 06:44:11 +00:00
Owen Anderson
e255773f3d Teach the MC to output code/data region marker labels in MachO and ELF modes. These are used by disassemblers to provide better disassembly, particularly on targets like ARM Thumb that like to intermingle data in the TEXT segment.
llvm-svn: 141135
2011-10-04 23:26:17 +00:00
Duncan Sands
33f33411e8 Darwin wants ctors/dtors to be ordered the other way round to linux.
llvm-svn: 139015
2011-09-02 18:07:19 +00:00
Rafael Espindola
9b3e6a9cb4 Rename DwarfRequiresRelocationForStmtList to
DwarfRequiresRelocationForSectionOffset as this is not specific to StmtList.

llvm-svn: 131148
2011-05-10 20:35:05 +00:00
Rafael Espindola
8346c59e6a Producing a DW_FORM_addr for DW_AT_stmt_list is probably correct, but
it is both inefficient and unexpected by dwarfdump. Change to
a DW_FORM_data4.

While in here, change the predicate name to reflect that the position
is not really absolute (it is an offset), just that the linker needs a
relocation.

llvm-svn: 130846
2011-05-04 17:44:06 +00:00
Rafael Espindola
2f2c3bf31f Simplify the handling of pcrel relocations on ELF. Now we do the right thing
for all symbol differences and can drop the old EmitPCRelSymbolValue
method.

This also make getExprForFDESymbol on ELF equal to the one on MachO, and it
can be made non-virtual.

llvm-svn: 130634
2011-05-01 03:50:49 +00:00
Rafael Espindola
be5cb08cf8 Add the getExprForFDESymbol method that responsible for computing the
expressions used in the FDE to refer to symbols.

llvm-svn: 130437
2011-04-28 21:04:39 +00:00
Rafael Espindola
f75a67d261 Add a getExprForPersonalitySymbol method to MCAsmInfo. Use it when
converting the symbol passed to .cfi_personality into bytes is the file.

llvm-svn: 130400
2011-04-28 16:09:09 +00:00
Stuart Hastings
c0c38e8673 Omit private_extern declarations of extern symbols; followup to
r124468.  Patch by Rafael Avila de Espindola!

llvm-svn: 126297
2011-02-23 02:27:05 +00:00
Rafael Espindola
81ac7c5fad Rename NeedsSetToChangeDiffSize to HasAggressiveSymbolFolding which is a much
better name and matches what is used in the MachO writer.

llvm-svn: 122443
2010-12-22 21:51:29 +00:00
Rafael Espindola
3e954d16f4 Second try at making direct object emission produce the same results
as llc + llvm-mc. This time ELF is not changed and I tested that llvm-gcc
bootstrap on darwin10 using darwin9's assembler and linker.

llvm-svn: 121006
2010-12-06 17:27:56 +00:00
Rafael Espindola
50b6170457 Next step: Only pad debug_line when the target is darwin. Add a FIXME to avoid
doing that if the target is darwin10 or newer.

This fixes
*) Direct object emission was producing objects without the workaround on
   darwin9.
*) Assembly printing was producing objects with the workaround on linux.

llvm-svn: 120866
2010-12-04 00:31:13 +00:00
Kevin Enderby
214e641d8d Added support for the Mach-O .symbol_resolver directive. rdar://8673046
llvm-svn: 119816
2010-11-19 18:39:33 +00:00
Devang Patel
bbbd35d042 Fix .debug_range for linux. Patch by Krister Wombell.
llvm-svn: 112830
2010-09-02 16:43:44 +00:00
Devang Patel
9e8ee9242f Use absolute label for DW_AT_stmt_list if a target does not prefer offset here.
This patch was developed on top of original patch by Artur Pietrek.

llvm-svn: 112678
2010-08-31 23:50:19 +00:00
Kevin Enderby
8a8d96b89c Revert some unneeded parts of the change in r107886 for the
.weak_def_can_be_hidden directive.  Chris pointed out that the MCAsmInfo.h/.cpp
chunks aren't needed for this until the compiler starts generating these.  And
when that happens it will be more convenient for it to be a bool than a const
char*.

llvm-svn: 107906
2010-07-08 20:30:44 +00:00
Kevin Enderby
9bf8ee521c Added the darwin .weak_def_can_be_hidden directive.
llvm-svn: 107886
2010-07-08 17:22:42 +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
Eric Christopher
1a7bc06b28 Partial code for emitting thread local bss data.
llvm-svn: 104197
2010-05-20 00:49:07 +00:00
Chris Lattner
e34dde1e83 move three lowering hooks from MAI to TLOF and make one of them
semantic instead of syntactic.  This completes MCization of
darwin/x86[-64]!

llvm-svn: 98145
2010-03-10 07:20:42 +00:00
Chris Lattner
325a36c358 Eliminate SetDirective, and replace it with HasSetDirective.
Default HasSetDirective to true, since most targets have it.

The targets that claim to not have it probably do, or it is
spelled differently. These include Blackfin, Mips, Alpha, and
PIC16.  All of these except pic16 are normal ELF targets, so
they almost certainly have it.

llvm-svn: 94585
2010-01-26 20:40:54 +00:00
Rafael Espindola
f46baf3304 Emit .comm alignment in bytes but .align in powers of 2 for ARM ELF.
Original patch by Sandeep Patel and updated by me.

llvm-svn: 94582
2010-01-26 20:21:43 +00:00
Chris Lattner
044439c9bc eliminate MCAsmInfo::NeedsSet: we now just use .set on any platform
that has it.

llvm-svn: 94581
2010-01-26 20:20:43 +00:00
Chris Lattner
7e1fa376cc resolve a fixme: the "nonexecutable stack directive" is actually
a .section.  Switch to it with SwitchSection.

However, I think that this directive should be safe on any ELF target.
If so, we should hoist it up out of the X86 and SystemZ targets.

llvm-svn: 94298
2010-01-23 07:21:06 +00:00
Chris Lattner
56c318f344 mcize visibility directives.
llvm-svn: 94295
2010-01-23 06:53:23 +00:00
Chris Lattner
62d08f5577 mcstreamerize .no_dead_strip and .reference for static ctors/dtors.
llvm-svn: 94290
2010-01-23 05:51:36 +00:00
Chris Lattner
f25a9e1265 revert 93934, removing the MCAsmInfo endianness bit. I can't
stomache MCAsmInfo having this, and I found a better solution to
this layering issue.

llvm-svn: 93985
2010-01-20 06:34:14 +00:00
Chris Lattner
8e3badb9a7 give MCAsmInfo a 'has little endian' bit. This is unfortunate, but
I really want clients of the streamer to be able to say "emit this
64-bit integer" and have it get broken down right by the streamer.

I may change this in the future, we'll see how it works out.

llvm-svn: 93934
2010-01-19 22:42:28 +00:00
Chris Lattner
15e2a64ec2 stop using the .lcomm pseudoop on darwin, instead, directly use the
.zerofill directive.  Streamerize its generation.

llvm-svn: 93868
2010-01-19 06:25:51 +00:00
Chris Lattner
7351e3a364 add a bool for whether .lcomm takes an alignment instead of basing this on "isdarwin".
llvm-svn: 93852
2010-01-19 04:48:20 +00:00
Chris Lattner
3821a5f168 move production of .reference directives for static ctor/dtor list on
darwin into common code.

llvm-svn: 93849
2010-01-19 04:34:02 +00:00
Chris Lattner
816fcd1287 Cleanup handling of .zerofill on darwin:
1. TargetLoweringObjectFileMachO should decide if something
   goes in zerofill instead of having every target do it.
2. TargetLoweringObjectFileMachO should assign said symbols to
   the right MCSection, the asmprinters should just emit to the
   right section.
3. Since all zerofill stuff goes through mcstreamer anymore,
   MAI can have a bool "haszerofill" instead of having the textual
   directive to emit.

llvm-svn: 93838
2010-01-19 02:09:44 +00:00
Chris Lattner
7b52d90c9e Big change #1 for personality function references:
Eliminate the PersonalityPrefix/Suffix & NeedsIndirectEncoding
fields from MAI: they aren't part of the asm syntax, they are
related to the structure of the object file.

To replace their functionality, add a new 
TLOF::getSymbolForDwarfGlobalReference method which asks targets
to decide how to reference a global from EH in a pc-relative way.

The default implementation just returns the symbol.  The default
darwin implementation references the symbol through an indirect
$non_lazy_ptr stub.  The bizarro x86-64 darwin specialization
handles the weird "foo@GOTPCREL+4" hack.

DwarfException.cpp now uses this to emit the reference to the
symbol in the right way, and this also eliminates another 
horrible hack from DwarfException.cpp:

-    if (strcmp(MAI->getPersonalitySuffix(), "+4@GOTPCREL"))
-      O << "-" << MAI->getPCSymbol();

llvm-svn: 81991
2009-09-16 01:46:41 +00:00
Chris Lattner
cb05a87447 remove MAI::JumpTableSpecialLabelPrefix now that MAI
has real information about linker private linkage.

llvm-svn: 81695
2009-09-13 19:02:16 +00:00
Bill Wendling
a6284af6bb Revert last patch. We need to put this into TargetLowering. There will be a lot
of EH stuff going into there, so we can wait to add them all then.

llvm-svn: 80036
2009-08-25 21:31:39 +00:00
Bill Wendling
4dd702ce66 Add a target asm info hook to specify that particular bits of data in the FDE
should be forced to 32-bits (.long) even on 64-bit architectures. Darwin wants
these bits to be 64-bits (.quad). However, other platforms may disagree.

This is just the info right now and is part of a work-in-progress which needs
this. We'll add the actual *use* of this soon.

llvm-svn: 80024
2009-08-25 20:21:17 +00:00
Chris Lattner
384b7d24a9 rename COFFMCAsmInfo -> MCAsmInfoCOFF, likewise for darwin.
llvm-svn: 79773
2009-08-22 21:03:30 +00:00
Chris Lattner
9f2ba3294f move the MCAsmInfo .cpp/.h files into the right
directories and rename them.

llvm-svn: 79768
2009-08-22 20:58:17 +00:00