Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								56f13732e2 
								
							 
						 
						
							
							
								
								MC/Mach-O/ARM: Fix thinko.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122406 
							
						 
						
							2010-12-22 16:19:20 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								50ce2f06de 
								
							 
						 
						
							
							
								
								Use references and simplify.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122405 
							
						 
						
							2010-12-22 16:11:57 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								73c0ae77ca 
								
							 
						 
						
							
							
								
								Simplify the handling of .size expressions.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122404 
							
						 
						
							2010-12-22 16:03:00 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								083132e131 
								
							 
						 
						
							
							
								
								MC/Mach-O/ARM: Stub out RecordARMRelocation, which is mostly a copy of  
							
							 
							
							... 
							
							
							
							RecordRelocation with lots of FIXMEs.
llvm-svn: 122402 
							
						 
						
							2010-12-22 13:50:05 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								a63db77f2e 
								
							 
						 
						
							
							
								
								Simplify.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122401 
							
						 
						
							2010-12-22 13:49:56 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								1e5be3653c 
								
							 
						 
						
							
							
								
								MC/Mach-O: Split out RecordARMRelocation for now, it is weird enough it isn't  
							
							 
							
							... 
							
							
							
							clear how to keep in the generic path (yet).
 - Will revisit when it actually works.
llvm-svn: 122400 
							
						 
						
							2010-12-22 13:49:43 +00:00  
						
					 
				
					
						
							
							
								 
								Matt Beaumont-Gay
							
						 
						
							 
							
							
							
							
								
							
							
								890cb2d506 
								
							 
						 
						
							
							
								
								GCC objects to the two sides of a conditional expression having different enum  
							
							 
							
							... 
							
							
							
							types, but they're just getting converted to unsigned anyway, so cast first
(and ask questions later).
llvm-svn: 122377 
							
						 
						
							2010-12-21 23:43:23 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								a468ae02cb 
								
							 
						 
						
							
							
								
								Simplify EvaluateAsAbsolute now that EvaluateAsRelocatableImpl does all  
							
							 
							
							... 
							
							
							
							the folding it can.
llvm-svn: 122359 
							
						 
						
							2010-12-21 20:51:42 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								6bdb49ded8 
								
							 
						 
						
							
							
								
								Don't relax org or align. They change size as the relaxation happens, but they  
							
							 
							
							... 
							
							
							
							are not actually relaxed. For example, a section with only alignments will never
needs relaxation.
llvm-svn: 122356 
							
						 
						
							2010-12-21 20:35:18 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								ff78eda678 
								
							 
						 
						
							
							
								
								MC/Mach-O: Shuffle enums a bit to make it harder to inadvertently use the wrong  
							
							 
							
							... 
							
							
							
							type.
llvm-svn: 122334 
							
						 
						
							2010-12-21 15:26:45 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								98d93c5294 
								
							 
						 
						
							
							
								
								Layout one section until no relaxations are done and then move to the next  
							
							 
							
							... 
							
							
							
							section.
This helps because in practice sections form a dag with debug sections pointing
to text sections. Finishing up the text sections first makes the debug section
relaxation trivial.
llvm-svn: 122314 
							
						 
						
							2010-12-21 04:22:09 +00:00  
						
					 
				
					
						
							
							
								 
								Roman Divacky
							
						 
						
							 
							
							
							
							
								
							
							
								55184ddd35 
								
							 
						 
						
							
							
								
								Set the value of absolute symbols.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122268 
							
						 
						
							2010-12-20 21:14:39 +00:00  
						
					 
				
					
						
							
							
								 
								Nick Lewycky
							
						 
						
							 
							
							
							
							
								
							
							
								0de20af7ba 
								
							 
						 
						
							
							
								
								Add missing standard headers. Patch by Joerg Sonnenberger!  
							
							 
							
							... 
							
							
							
							llvm-svn: 122193 
							
						 
						
							2010-12-19 20:43:38 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								ee54636f0a 
								
							 
						 
						
							
							
								
								Fixed version of 122160 (the previous one would fold undefined symbols).  
							
							 
							
							... 
							
							
							
							llvm-svn: 122167 
							
						 
						
							2010-12-19 04:18:56 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								9a2d4e04c7 
								
							 
						 
						
							
							
								
								Revert 122160 while I debug it.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122165 
							
						 
						
							2010-12-19 03:22:05 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								6fd80a5593 
								
							 
						 
						
							
							
								
								Move all folding to AttemptToFoldSymbolOffsetDifference.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122160 
							
						 
						
							2010-12-19 02:15:04 +00:00  
						
					 
				
					
						
							
							
								 
								Roman Divacky
							
						 
						
							 
							
							
							
							
								
							
							
								71d29167ea 
								
							 
						 
						
							
							
								
								Add support for lexing single quotes like 'c'.  
							
							 
							
							... 
							
							
							
							This fixed 8615.
llvm-svn: 122150 
							
						 
						
							2010-12-18 08:56:37 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								b403e098a1 
								
							 
						 
						
							
							
								
								Merge isAbsolute into IsSymbolRefDifferenceFullyResolved.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122148 
							
						 
						
							2010-12-18 06:27:54 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								8396dd0893 
								
							 
						 
						
							
							
								
								Remove the MCObjectFormat class.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122147 
							
						 
						
							2010-12-18 05:37:28 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								293a7c1840 
								
							 
						 
						
							
							
								
								Add a FIXME and explain a hack.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122144 
							
						 
						
							2010-12-18 04:19:20 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								1ea7f18caa 
								
							 
						 
						
							
							
								
								Fix the note.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122139 
							
						 
						
							2010-12-18 04:01:45 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								5004f4a9b5 
								
							 
						 
						
							
							
								
								Revert 122011, 122012, 122013, 122023 adding back an important optimization.  
							
							 
							
							... 
							
							
							
							I added a note, but suggestions on how to add a test are really welcome.
llvm-svn: 122138 
							
						 
						
							2010-12-18 03:57:21 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								fdaae0d16f 
								
							 
						 
						
							
							
								
								Move some data to the TargetWriter.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122134 
							
						 
						
							2010-12-18 03:27:34 +00:00  
						
					 
				
					
						
							
							
								 
								Owen Anderson
							
						 
						
							 
							
							
							
							
								
							
							
								79855298b9 
								
							 
						 
						
							
							
								
								Thumb's forced-PC-alignment requirement applies to the _total_ displacement, not just to the fragment relative  
							
							 
							
							... 
							
							
							
							portion.  While the fragment boundary is usually already aligned, it is possible for it not to be, which 
would lead to a non-aligned final displacement.
llvm-svn: 122091 
							
						 
						
							2010-12-17 21:49:48 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								d11460a65b 
								
							 
						 
						
							
							
								
								Store and free the TargetObjectWriter.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122070 
							
						 
						
							2010-12-17 18:01:31 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								6b5e56c2b1 
								
							 
						 
						
							
							
								
								Stub out explicit MCELFObjectTargetWriter interface.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122067 
							
						 
						
							2010-12-17 17:45:22 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								f0e24d426a 
								
							 
						 
						
							
							
								
								Move createELFObjectWriter to its own header.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122064 
							
						 
						
							2010-12-17 16:59:53 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								df63335844 
								
							 
						 
						
							
							
								
								Use getFixupKindInfo to implement isFixupKindPCRel, ELF version.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122050 
							
						 
						
							2010-12-17 07:28:17 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								137d422e50 
								
							 
						 
						
							
							
								
								MC/Expr: Implemnt more aggressive folding during symbol evaluation using  
							
							 
							
							... 
							
							
							
							IsSymbolRefDifferenceFullyResolved(). For example, we will now fold away
something like:
--
_a:
...
L0:
...
L1:
...
.long (L1 - L0) / 2
--
llvm-svn: 122043 
							
						 
						
							2010-12-17 05:50:33 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								2ee6c9b8c9 
								
							 
						 
						
							
							
								
								MC/Mach-O: On second thought, use a custom hook for enabling aggressive  
							
							 
							
							... 
							
							
							
							IsSymbolRefDifferenceFullyResolved, it turns out this does change behavior on
enough cases for x86-32 that I would rather wait a bit on it.
 - In practice, we will want to change this eventually because it only means we
   generate less relocations (it also eliminates the need for the horrible
   '.set' hack that Darwin requires in some places).
llvm-svn: 122042 
							
						 
						
							2010-12-17 05:50:29 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								b27bb86ba5 
								
							 
						 
						
							
							
								
								MC/Mach-O: Implement IsSymbolRefDifferenceFullyResolved.  
							
							 
							
							... 
							
							
							
							- Unlike for fixups, we always do the "reliable" thing (not just for x86_64).
 - Since Darwin 'as' would typically reject things that using this will allow,
   we don't need to worry about compatibility.
llvm-svn: 122038 
							
						 
						
							2010-12-17 04:54:58 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								f2adf782ab 
								
							 
						 
						
							
							
								
								MC/ObjectWriter: Add a new IsSymbolRefDifferenceFullyResolved target format specific hook.  
							
							 
							
							... 
							
							
							
							- Currently just has stub implementations for Mach-O, ELF, and COFF.
llvm-svn: 122037 
							
						 
						
							2010-12-17 04:54:54 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								50269280f8 
								
							 
						 
						
							
							
								
								MC/Assembler: Strip out object writer arguments, now that it is always available  
							
							 
							
							... 
							
							
							
							-- and remove FIXME asking for the same!
llvm-svn: 122032 
							
						 
						
							2010-12-17 02:45:59 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								42a037abb1 
								
							 
						 
						
							
							
								
								MC/Assembler: Make the MCObjectWriter available through the lifetime of the  
							
							 
							
							... 
							
							
							
							assembler.
llvm-svn: 122031 
							
						 
						
							2010-12-17 02:45:41 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								d2867f13a0 
								
							 
						 
						
							
							
								
								MC/Target: Remove HasScatteredSymbols target hook variable, which has been  
							
							 
							
							... 
							
							
							
							superceded and was effectively dead.
llvm-svn: 122024 
							
						 
						
							2010-12-17 02:06:08 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								e491ea4630 
								
							 
						 
						
							
							
								
								MC/Expr: Simplify.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122023 
							
						 
						
							2010-12-17 02:05:45 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								f89156da92 
								
							 
						 
						
							
							
								
								MC: Remove another dead MCAssembler argument, and update clients.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122013 
							
						 
						
							2010-12-17 01:07:35 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								f15aeb8d01 
								
							 
						 
						
							
							
								
								MC: Remove dead MCAssembler argument -- Rafael, can you check the FIXME I added  
							
							 
							
							... 
							
							
							
							here?
llvm-svn: 122012 
							
						 
						
							2010-12-17 01:07:31 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								9af1335b5d 
								
							 
						 
						
							
							
								
								MC: Simplify (remove unnecessary MCAssembler argument, obsoleted by containment  
							
							 
							
							... 
							
							
							
							in MCAsmLayout).
llvm-svn: 122011 
							
						 
						
							2010-12-17 01:07:28 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								33d571e2ae 
								
							 
						 
						
							
							
								
								Write => in a more normal form.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122009 
							
						 
						
							2010-12-17 01:07:22 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								76793bac89 
								
							 
						 
						
							
							
								
								MC/Expr: Simplify (and add a FIXME).  
							
							 
							
							... 
							
							
							
							llvm-svn: 122008 
							
						 
						
							2010-12-17 01:07:20 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								32c74ea3ab 
								
							 
						 
						
							
							
								
								"Fix" FDE alignment to match what gas does.  
							
							 
							
							... 
							
							
							
							llvm-svn: 122006 
							
						 
						
							2010-12-17 00:28:02 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								395a09922b 
								
							 
						 
						
							
							
								
								MC/Expr: Add a doxyment.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121988 
							
						 
						
							2010-12-16 18:36:25 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								03fcccbb47 
								
							 
						 
						
							
							
								
								MC/Mach-O: Lift some MachObjectWriter arguments into the target specific  
							
							 
							
							... 
							
							
							
							interface.
llvm-svn: 121981 
							
						 
						
							2010-12-16 17:21:02 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								8888a9604d 
								
							 
						 
						
							
							
								
								MC/Mach-O: Stub out explicit MCMachObjectTargetWriter interface.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121973 
							
						 
						
							2010-12-16 16:09:19 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								73b8713d7c 
								
							 
						 
						
							
							
								
								MC/Mach-O: Move createMachObjectWriter into MCMachObjectWriter.h.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121971 
							
						 
						
							2010-12-16 16:08:33 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								9d1ed19982 
								
							 
						 
						
							
							
								
								MC/Mach-O: Use fixup info instead of hard coded list.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121970 
							
						 
						
							2010-12-16 15:42:31 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								0c9d9fdd81 
								
							 
						 
						
							
							
								
								MC: Move target specific fixup info descriptors to TargetAsmBackend instead of  
							
							 
							
							... 
							
							
							
							the MCCodeEmitter, which seems like a better organization.
 - Also, cleaned up some magic constants while in the area.
llvm-svn: 121953 
							
						 
						
							2010-12-16 03:20:06 +00:00  
						
					 
				
					
						
							
							
								 
								Jason W Kim
							
						 
						
							 
							
							
							
							
								
							
							
								4c1386add9 
								
							 
						 
						
							
							
								
								1. ARM/MC/ELF: A few more ELF relocs for .o  
							
							 
							
							... 
							
							
							
							2. Fixed EmitLocalCommonSymbol for ELF (Yes, they exist. :)
   Test added.
llvm-svn: 121951 
							
						 
						
							2010-12-16 03:12:17 +00:00  
						
					 
				
					
						
							
							
								 
								Daniel Dunbar
							
						 
						
							 
							
							
							
							
								
							
							
								ecd0c8a557 
								
							 
						 
						
							
							
								
								MC: Make TargetAsmBackend available to the AsmStreamer.  
							
							 
							
							... 
							
							
							
							- Treaty talks on the non-proliferation of MC objects broke down.
llvm-svn: 121949 
							
						 
						
							2010-12-16 03:05:59 +00:00  
						
					 
				
					
						
							
							
								 
								Matt Beaumont-Gay
							
						 
						
							 
							
							
							
							
								
							
							
								f991d4f587 
								
							 
						 
						
							
							
								
								Better fix for opt build  
							
							 
							
							... 
							
							
							
							llvm-svn: 121910 
							
						 
						
							2010-12-15 23:14:45 +00:00  
						
					 
				
					
						
							
							
								 
								Matt Beaumont-Gay
							
						 
						
							 
							
							
							
							
								
							
							
								15f96baa01 
								
							 
						 
						
							
							
								
								Fix opt -Werror build  
							
							 
							
							... 
							
							
							
							llvm-svn: 121904 
							
						 
						
							2010-12-15 22:21:20 +00:00  
						
					 
				
					
						
							
							
								 
								Owen Anderson
							
						 
						
							 
							
							
							
							
								
							
							
								c8fa5fcc42 
								
							 
						 
						
							
							
								
								Fix typo in r121875.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121880 
							
						 
						
							2010-12-15 19:24:24 +00:00  
						
					 
				
					
						
							
							
								 
								Owen Anderson
							
						 
						
							 
							
							
							
							
								
							
							
								622ad5170b 
								
							 
						 
						
							
							
								
								Implement cleanups suggested by Daniel.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121875 
							
						 
						
							2010-12-15 18:48:27 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								844f6b6cfb 
								
							 
						 
						
							
							
								
								Relax alignment fragments.  
							
							 
							
							... 
							
							
							
							With this we don't need the EffectiveSize field anymore. Without that field
LayoutFragment only updates offsets and we don't need to invalidate the
current fragment when it is relaxed (only the ones following it).
This is also a very small improvement in the accuracy of the layout info as
we now use the after relaxation size immediately.
llvm-svn: 121857 
							
						 
						
							2010-12-15 08:45:53 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								8911d03504 
								
							 
						 
						
							
							
								
								Patch by David Meyer to avoid a O(N^2) behaviour when relaxing fragments.  
							
							 
							
							... 
							
							
							
							Since we now don't update addresses so early, we might relax a bit more than
we need to. This is simillar to the issue in PR8467.
llvm-svn: 121856 
							
						 
						
							2010-12-15 07:39:29 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								f80f18a11a 
								
							 
						 
						
							
							
								
								Generalize an assert.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121851 
							
						 
						
							2010-12-15 07:12:24 +00:00  
						
					 
				
					
						
							
							
								 
								Jim Grosbach
							
						 
						
							 
							
							
							
							
								
							
							
								41955ff958 
								
							 
						 
						
							
							
								
								ARM Fixups relative to thumb functions need to have the low bit of the value  
							
							 
							
							... 
							
							
							
							set for interworking to work properly. rdar://8755956
llvm-svn: 121778 
							
						 
						
							2010-12-14 18:46:57 +00:00  
						
					 
				
					
						
							
							
								 
								Jason W Kim
							
						 
						
							 
							
							
							
							
								
							
							
								0e909c5f9c 
								
							 
						 
						
							
							
								
								First cut of ARM/MC/ELF PIC relocations.  
							
							 
							
							... 
							
							
							
							Test has fixme, to move to .s -> .o test when AsmParser works better.
llvm-svn: 121732 
							
						 
						
							2010-12-13 23:16:07 +00:00  
						
					 
				
					
						
							
							
								 
								Jim Grosbach
							
						 
						
							 
							
							
							
							
								
							
							
								e119da1146 
								
							 
						 
						
							
							
								
								Thumb unconditional branch binary encoding. rdar://8754994  
							
							 
							
							... 
							
							
							
							llvm-svn: 121496 
							
						 
						
							2010-12-10 18:21:33 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								0a017a6db2 
								
							 
						 
						
							
							
								
								Fixed version of 121434 with no new memory leaks.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121471 
							
						 
						
							2010-12-10 07:39:47 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								a945a34c73 
								
							 
						 
						
							
							
								
								Revert my previous patch to make the valgrind bots happy.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121461 
							
						 
						
							2010-12-10 04:01:09 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								56eb741237 
								
							 
						 
						
							
							
								
								Initial support for the cfi directives. This is just enough to get  
							
							 
							
							... 
							
							
							
							f:
        .cfi_startproc
        nop
        .cfi_endproc
assembled (on ELF).
llvm-svn: 121434 
							
						 
						
							2010-12-09 23:48:29 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								d66e65df03 
								
							 
						 
						
							
							
								
								Use const references.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121426 
							
						 
						
							2010-12-09 23:08:35 +00:00  
						
					 
				
					
						
							
							
								 
								Owen Anderson
							
						 
						
							 
							
							
							
							
								
							
							
								3ef19d9d48 
								
							 
						 
						
							
							
								
								Fix an issue in some Thumb fixups, where the effective PC address needs to be 4-byte aligned when calculating  
							
							 
							
							... 
							
							
							
							the offset.  Add a new fixup flag to represent this, and use it for the one fixups that I have a testcase for needing
this.  It's quite likely that the other Thumb fixups will need this too, and to have their fixup encoding logic
adjusted accordingly.
llvm-svn: 121408 
							
						 
						
							2010-12-09 20:27:52 +00:00  
						
					 
				
					
						
							
							
								 
								Jim Grosbach
							
						 
						
							 
							
							
							
							
								
							
							
								68b27eb9d1 
								
							 
						 
						
							
							
								
								Rename CB/CBZ specific fixup accordingly.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121404 
							
						 
						
							2010-12-09 19:50:12 +00:00  
						
					 
				
					
						
							
							
								 
								Devang Patel
							
						 
						
							 
							
							
							
							
								
							
							
								3ebe3defe3 
								
							 
						 
						
							
							
								
								Add assert to catch an attempt to emit .byte 256  
							
							 
							
							... 
							
							
							
							llvm-svn: 121402 
							
						 
						
							2010-12-09 19:26:21 +00:00  
						
					 
				
					
						
							
							
								 
								Jason W Kim
							
						 
						
							 
							
							
							
							
								
							
							
								c79c5f6e8c 
								
							 
						 
						
							
							
								
								ARM/MC/ELF TPsoft is now a proper pseudo inst.  
							
							 
							
							... 
							
							
							
							Added test to check bl __aeabi_read_tp gets emitted properly for ELF/ASM
as well as ELF/OBJ (including fixup)
Also added support for ELF::R_ARM_TLS_IE32
llvm-svn: 121312 
							
						 
						
							2010-12-08 23:14:44 +00:00  
						
					 
				
					
						
							
							
								 
								Bill Wendling
							
						 
						
							 
							
							
							
							
								
							
							
								a7d6aa902a 
								
							 
						 
						
							
							
								
								Support the "target" encodings for the CB[N]Z instructions.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121308 
							
						 
						
							2010-12-08 23:01:43 +00:00  
						
					 
				
					
						
							
							
								 
								Bill Wendling
							
						 
						
							 
							
							
							
							
								
							
							
								8a6449c46e 
								
							 
						 
						
							
							
								
								Add support for loading from a constant pool.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121226 
							
						 
						
							2010-12-08 01:57:09 +00:00  
						
					 
				
					
						
							
							
								 
								Jim Grosbach
							
						 
						
							 
							
							
							
							
								
							
							
								87055ed6f4 
								
							 
						 
						
							
							
								
								Let target asm backends see assembler flags as they go by. Use that to handle  
							
							 
							
							... 
							
							
							
							thumb vs. arm mode differences in WriteNopData().
llvm-svn: 121219 
							
						 
						
							2010-12-08 01:16:55 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								6624f47272 
								
							 
						 
						
							
							
								
								Layout each section independently. With the testcase in PR8711:  
							
							 
							
							... 
							
							
							
							before:
        4 assembler - Number of assembler layout and relaxation steps
    78563 assembler - Number of emitted assembler fragments
  8693904 assembler - Number of emitted object file bytes
   271223 assembler - Number of evaluated fixups
330771677 assembler - Number of fragment layouts
     5958 assembler - Number of relaxed instructions
  2508361 mcexpr    - Number of MCExpr evaluations
real	0m26.123s
user	0m25.694s
sys	0m0.388s
after:
      4 assembler - Number of assembler layout and relaxation steps
  78563 assembler - Number of emitted assembler fragments
8693904 assembler - Number of emitted object file bytes
 271223 assembler - Number of evaluated fixups
 231507 assembler - Number of fragment layouts
   5958 assembler - Number of relaxed instructions
2508361 mcexpr    - Number of MCExpr evaluations
real	0m2.500s
user	0m2.113s
sys	0m0.273s
And yes, the outputs are identical :-)
llvm-svn: 121207 
							
						 
						
							2010-12-07 23:32:26 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								e78d3b38de 
								
							 
						 
						
							
							
								
								Fix absolute recording of differences of symbols in two sections. Reduced from ctor_dtor_count-2.cpp.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121152 
							
						 
						
							2010-12-07 17:12:32 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								bdbe5a712d 
								
							 
						 
						
							
							
								
								Fix relocations with weak definitions.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121114 
							
						 
						
							2010-12-07 05:57:28 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								2eabaae459 
								
							 
						 
						
							
							
								
								Fix pcrel relocations that cross sections.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121107 
							
						 
						
							2010-12-07 03:50:14 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								a2421ec705 
								
							 
						 
						
							
							
								
								Fix a crash reduced from gcc produced assembly.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121085 
							
						 
						
							2010-12-07 01:09:54 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								93e3cf0ebd 
								
							 
						 
						
							
							
								
								Sorry for such a large commit. The summary is that only MachO cares about the  
							
							 
							
							... 
							
							
							
							actuall addresses in a .o file, so it is better to let the MachO writer compute
it.
This is good for two reasons. First, areas that shouldn't care about
addresses now don't have access to it. Second, the layout of each section
is independent. I should use this in a subsequent commit to speed it up.
Most of the patch is just removing the section address computation. The two
interesting parts are the change on how we handle padding in the end
of sections and how MachO can get the address of a-b when a and b are in
different sections.
Since now the expression evaluation normally doesn't know the section address,
it will think that a-b needs relocation and let the MachO writer know. Once
it has computed the section addresses, it calls back the expression evaluation
with the section addresses to resolve these expressions.
The remaining problem is the handling of padding. Currently it will create
a special alignment fragment at the end. Since that fragment doesn't update
the alignment of the section, it needs the real address to be computed.
Since now the layout will not compute a-b with a and b in different sections,
the only effect that the special alignment fragment has is update the
address size of the section. This can also be done by the MachO writer.
llvm-svn: 121076 
							
						 
						
							2010-12-07 00:27:36 +00:00  
						
					 
				
					
						
							
							
								 
								Jim Grosbach
							
						 
						
							 
							
							
							
							
								
							
							
								9e1994698d 
								
							 
						 
						
							
							
								
								Add fixup for Thumb1 BL/BLX instructions.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121072 
							
						 
						
							2010-12-06 23:57:07 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								1055f72b97 
								
							 
						 
						
							
							
								
								Use references to simplify the code a bit.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121050 
							
						 
						
							2010-12-06 22:30:54 +00:00  
						
					 
				
					
						
							
							
								 
								Jason W Kim
							
						 
						
							 
							
							
							
							
								
							
							
								495c2bb9a6 
								
							 
						 
						
							
							
								
								Refactor ELFObjectWriter.  
							
							 
							
							... 
							
							
							
							+ ARM/X86/MBlaze now share a common RecordRelocation
+ ARM/X86/MBlaze arch specific routines are limited to GetRelocType()
llvm-svn: 121043 
							
						 
						
							2010-12-06 21:57:34 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								e134b08daa 
								
							 
						 
						
							
							
								
								use getSymbolOffset.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121041 
							
						 
						
							2010-12-06 21:51:55 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								408344017e 
								
							 
						 
						
							
							
								
								Another use of getSymbolOffset.  
							
							 
							
							... 
							
							
							
							llvm-svn: 121034 
							
						 
						
							2010-12-06 19:55:05 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								0f30fec0bd 
								
							 
						 
						
							
							
								
								Remove the instruction fragment to data fragment lowering since it was causing  
							
							 
							
							... 
							
							
							
							freed data to be read. I will open a bug to track it being reenabled.
llvm-svn: 121028 
							
						 
						
							2010-12-06 19:08:48 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								44bbe36de6 
								
							 
						 
						
							
							
								
								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
							
						 
						
							 
							
							
							
							
								
							
							
								dee3062373 
								
							 
						 
						
							
							
								
								Revert previous two patches while I try to find out how to make both  
							
							 
							
							... 
							
							
							
							linux and darwin assemblers happy :-(
llvm-svn: 121004 
							
						 
						
							2010-12-06 15:35:15 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								34a06a0802 
								
							 
						 
						
							
							
								
								Add an EmitAbsValue helper method and use it in cases where we want to be sure  
							
							 
							
							... 
							
							
							
							that no relocations are used (on MochO).
Fixes llc producing different output from llc + llvm-mc.
llvm-svn: 121000 
							
						 
						
							2010-12-06 14:53:14 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								baf2f3b3eb 
								
							 
						 
						
							
							
								
								Remove the getAddress getter, initialize Ordinal in the constructor and use  
							
							 
							
							... 
							
							
							
							that on the ELF writer to detect a section we created.
llvm-svn: 120981 
							
						 
						
							2010-12-06 03:48:09 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								46e40188f7 
								
							 
						 
						
							
							
								
								Simplify a bit.  
							
							 
							
							... 
							
							
							
							llvm-svn: 120980 
							
						 
						
							2010-12-06 03:36:43 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								45790b82af 
								
							 
						 
						
							
							
								
								Use getSymbolOffset on the COFF writer.  
							
							 
							
							... 
							
							
							
							llvm-svn: 120979 
							
						 
						
							2010-12-06 03:24:04 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								ac60adb38d 
								
							 
						 
						
							
							
								
								Don't use PadSectionToAlignment on windows.  
							
							 
							
							... 
							
							
							
							llvm-svn: 120978 
							
						 
						
							2010-12-06 03:03:44 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								e7284c3671 
								
							 
						 
						
							
							
								
								Add a getSymbolOffset method and use it in the ELF writer.  
							
							 
							
							... 
							
							
							
							llvm-svn: 120977 
							
						 
						
							2010-12-06 02:57:26 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								8867390cf2 
								
							 
						 
						
							
							
								
								Once the layout is done we don't need to keep updating which fragments are  
							
							 
							
							... 
							
							
							
							valid. Addresses will not change.
llvm-svn: 120921 
							
						 
						
							2010-12-04 22:47:22 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								99e026dbca 
								
							 
						 
						
							
							
								
								Remember the contents of leb and dwarfline fragments when relaxing. This avoids  
							
							 
							
							... 
							
							
							
							having to evaluate the expression again when writing.
llvm-svn: 120920 
							
						 
						
							2010-12-04 21:58:52 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								1c8ac8f027 
								
							 
						 
						
							
							
								
								There are two reasons why we might want to use  
							
							 
							
							... 
							
							
							
							foo = a - b
.long foo
instead of just
.long a - b
First, on darwin9 64 bits the assembler produces the wrong result. Second,
if "a" is the end of the section all darwin assemblers (9, 10 and mc) will not
consider a - b to be a constant but will if the dummy foo is created.
Split how we handle these cases. The first one is something MC should take care
of. The second one has to be handled by the caller.
llvm-svn: 120889 
							
						 
						
							2010-12-04 03:21:47 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								1048e75fb9 
								
							 
						 
						
							
							
								
								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  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								f8af778e1f 
								
							 
						 
						
							
							
								
								First step in fixing MC. Make it clear that we are avoiding a bug in the  
							
							 
							
							... 
							
							
							
							darwin9 linker, what is needed to avoid it and where to get more information.
Also make the workaround simpler. Just the regular end_sequence we normally
create is more than 4 bytes.
Tested by building cctools and ld64 from darwin9 on a darwin10 system and using
those. I checked that I was able to reproduce the bootstrap failure when
the the workaround was disabled.
llvm-svn: 120854 
							
						 
						
							2010-12-03 23:36:59 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								4c70eeaf33 
								
							 
						 
						
							
							
								
								Make EmitIntValue more efficient and more like what we do for leb128. The  
							
							 
							
							... 
							
							
							
							difference is much smaller (about 0.3s) but significant.
llvm-svn: 120787 
							
						 
						
							2010-12-03 02:54:21 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								675fbb2ad1 
								
							 
						 
						
							
							
								
								Do with uleb the same trick we now do with dwarf line/address advances. This  
							
							 
							
							... 
							
							
							
							avoids creating leb128 fragments and speeds up the test in PR8711 to 33s.
llvm-svn: 120774 
							
						 
						
							2010-12-03 01:19:49 +00:00  
						
					 
				
					
						
							
							
								 
								Rafael Espindola
							
						 
						
							 
							
							
							
							
								
							
							
								57ab708bdd 
								
							 
						 
						
							
							
								
								Try to resolve symbol differences early, and if successful create a plain  
							
							 
							
							... 
							
							
							
							data fragment. This reduces the time to assemble the test in 8711 from 60s to
54s.
llvm-svn: 120767 
							
						 
						
							2010-12-03 00:55:40 +00:00  
						
					 
				
					
						
							
							
								 
								Devang Patel
							
						 
						
							 
							
							
							
							
								
							
							
								5eed2e63f8 
								
							 
						 
						
							
							
								
								It may not be an option to skip .debug_line if there are file reference in already emitted debug info. So, for now, emit dummy line table entry to make older linker and assemblers happy. This is not a new behavior, original AsmPrinter emitted similar line table entries.  
							
							 
							
							... 
							
							
							
							llvm-svn: 120760 
							
						 
						
							2010-12-03 00:10:48 +00:00