llvm-6502/test/MC
David Blaikie 037da24c10 Update the fragments of symbols in compressed sections.
While unnamed relocations are already cached in side tables in
ELFObjectWriter::RecordRelocation, symbols still need their fragments
updated to refer to the newly compressed fragment (even if that fragment
isn't big enough to fit the offset). Even though we only create
temporary symbols in debug info sections this comes up in 32 bit builds
where even temporary symbols in mergeable sections (such as debug_str)
have to be emitted as named symbols.

I tried a few other ways to do this but they all didn't work for various
reasons:

1) Canonicalize the MCSymbolData in RecordRelocation, nulling out the
Fragment (so it didn't have to be updated by CompressDebugSection). This
doesn't work because some code relies on symbols having fragments to
indicate that they're defined, I think.

2) Canonicalize the MCSymbolData in RecordRelocation to be "first
fragment + absolute offset" so it would be cheaper to just test and
update the fragment in CompressDebugSections. This doesn't work because
the offset computed in RecordRelocation isn't that of the symbol's
fragment, it's the passed in fragment (I haven't figured out what that
fragment is - perhaps it's the location where the relocation is to be
written). And if the fragment offset has to be computed only for this
use we might as well just do it when we need to, in
CompressDebugSection.

I also added an assert to help catch this a bit more clearly, even
though it is UB. The test case improvements would either assert fail
and/or valgrind vail without the fix, even if they wouldn't necessarily
fail the FileCheck output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206653 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 21:24:12 +00:00
..
AArch64 AArch64/ARM64: produce correct relocation for conditional branches. 2014-04-16 15:27:52 +00:00
ARM Test commit - Added a new line 2014-04-16 16:45:18 +00:00
ARM64 ARM64: [su]xtw use W regs as inputs, not X regs. 2014-04-17 20:47:31 +00:00
AsmParser Revert r206565 (and r206566 which updated tests). 2014-04-18 09:35:51 +00:00
COFF COFF: fix an off by one error 2014-04-16 06:22:53 +00:00
Disassembler [X86] Add disassembler support for the 0x0f 0x7f form of movq %mm, %mm. 2014-04-17 06:33:45 +00:00
ELF Update the fragments of symbols in compressed sections. 2014-04-18 21:24:12 +00:00
MachO [MC] Emit an error if cfi_startproc is used before a symbol is defined. 2014-04-15 01:17:45 +00:00
Markup MC: Simple example parser for MC assembly markup. 2012-10-31 23:24:13 +00:00
Mips [mips] Use TwoOperandAliasConstraint for shift instructions. 2014-04-16 16:28:59 +00:00
PowerPC [MC] Emit an error if cfi_startproc is used before a symbol is defined. 2014-04-15 01:17:45 +00:00
Sparc [Sparc] Add trap on integer condition codes (Ticc) instructions to Sparc backend. 2014-03-02 23:39:07 +00:00
SystemZ [SystemZ] Add support for z196 float<->unsigned conversions 2014-03-21 10:56:30 +00:00
X86 AVX-512: Implemented masking for integer arithmetic & logic instructions. 2014-03-27 09:45:08 +00:00