| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
The fixup value comes in as the whole 32-bit value, so for the lo16 fixup,
the upper bits need to be masked off. Previously we assumed the masking had
already been done and asserted.
rdar://9635991
llvm-svn: 133818
|
|
|
|
|
|
| |
Just tidy up a bit. No functional change.
llvm-svn: 133638
|
|
|
|
| |
llvm-svn: 133002
|
|
|
|
| |
llvm-svn: 132246
|
|
|
|
|
|
|
|
| |
of tBL/tBLX to R_ARM_THM_CALL (ARM ELF 4.7.1.6)
Patch by koan-sin tan.
llvm-svn: 131748
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
text section.
Assume the following bit of annotated assembly:
.section .data.rel.ro,"aw",%progbits
.align 2
.LAlpha:
.long startval(GOTOFF)
.text
.align 2
.type main,%function
.align 4
main: ;;; assume "main" starts at offset 0x20
0x0 push {r11, lr}
0x4 movw r0, :lower16:(.LAlpha-(.LBeta+8))
;;; ==> (.AddrOf(.LAlpha) - ((.AddrOf(.LBeta) - .AddrOf(".")) + 8)
;;; ==> (??? - ((16-4) + 8) = -20
0x8 movt r0, :upper16:(.LAlpha-(.LBeta+8))
;;; ==> (.AddrOf(.LAlpha) - ((.AddrOf(.LBeta) - .AddrOf(".")) + 8)
;;; ==> (??? - ((16-8) + 8) = -16
0xc ... blah
.LBeta:
0x10 add r0, pc, r0
0x14 ... blah
.LGamma:
0x18 add r1, pc, r1
Above snippet results in the following relocs in the .o file for the
first pair of movw/movt instructions
00000024 R_ARM_MOVW_PREL_NC .LAlpha
00000028 R_ARM_MOVT_PREL .LAlpha
And the encoded instructions in the .o file for main: must be
00000020 <main>:
20: e92d4800 push {fp, lr}
24: e30f0fec movw r0, #65516 ; 0xffec i.e. -20
28: e34f0ff0 movt r0, #65520 ; 0xfff0 i.e. -16
However, llc (prior to this commit) generates the following sequence
00000020 <main>:
20: e92d4800 push {fp, lr}
24: e30f0fec movw r0, #65516 ; 0xffec - i.e. -20
28: e34f0fff movt r0, #65535 ; 0xffff - i.e. -1
What has to happen in the ArmAsmBackend is that if the relocation is PC
relative, the 16 bits encoded as part of movw and movt must be both addends,
not addresses. It makes sense to encode addresses by right shifting the value
by 16, but the result is incorrect for PIC.
i.e., the right shift by 16 for movt is ONLY valid for the NON-PCRel case.
This change agrees with what GNU as does, and makes the PIC code run.
MC/ARM/elf-movt.s covers this case.
llvm-svn: 131674
|
|
|
|
|
|
|
| |
DWARF stuff also gets fixed up by ELFARMAsmBackend::ApplyFixup(),
but the offset is not guaranteed to be mod 4 == 0 as in text/data.
llvm-svn: 131137
|
|
|
|
|
|
| |
predicates.
llvm-svn: 129816
|
|
|
|
|
|
| |
object file appropriately.
llvm-svn: 128739
|
|
|
|
|
|
| |
This fixes 464.h264ref with the integrated assembler.
llvm-svn: 128172
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(yes, this is different from R_ARM_CALL)
- Adds a new method getARMBranchTargetOpValue() which handles the
necessary distinction between the conditional and unconditional br/bl
needed for ARM/ELF
At least for ARM mode, the needed fixup for conditional versus unconditional
br/bl is identical, but the ARM docs and existing ARM tools expect this
reloc type...
Added a few FIXME's for future naming fixups in ARMInstrInfo.td
llvm-svn: 124895
|
|
|
|
|
|
|
|
| |
- Fixed :upper16: fix up routine. It should be shifting down the top 16 bits first.
- Added support for Thumb2 :lower16: and :upper16: fix up.
- Added :upper16: and :lower16: relocation support to mach-o object writer.
llvm-svn: 123424
|
|
|
|
|
|
|
|
| |
R_ARM_MOVT_PREL and R_ARM_MOVW_PREL_NC.
2. Fix minor bug in ARMAsmPrinter - treat bitfield flag as a bitfield, not an enum.
3. Add support for 3 new elf section types (no-ops)
llvm-svn: 123294
|
|
|
|
| |
llvm-svn: 122147
|
|
|
|
| |
llvm-svn: 122134
|
|
|
|
|
|
| |
a partial value. rdar://8782954
llvm-svn: 122078
|
|
|
|
| |
llvm-svn: 122075
|
|
|
|
| |
llvm-svn: 122067
|
|
|
|
| |
llvm-svn: 122064
|
|
|
|
| |
llvm-svn: 122044
|
|
|
|
|
|
| |
superceded and was effectively dead.
llvm-svn: 122024
|
|
|
|
|
|
| |
interface.
llvm-svn: 121981
|
|
|
|
| |
llvm-svn: 121973
|
|
|
|
| |
llvm-svn: 121971
|
|
|
|
|
|
|
| |
the MCCodeEmitter, which seems like a better organization.
- Also, cleaned up some magic constants while in the area.
llvm-svn: 121953
|
|
|
|
|
|
| |
it. I.e., it was always an immediate value.
llvm-svn: 121932
|
|
|
|
| |
llvm-svn: 121858
|
|
|
|
| |
llvm-svn: 121798
|
|
|
|
| |
llvm-svn: 121784
|
|
|
|
| |
llvm-svn: 121769
|
|
|
|
|
|
|
|
| |
much later, which makes the entire
process cleaner.
llvm-svn: 121735
|
|
|
|
| |
llvm-svn: 121726
|
|
|
|
|
|
|
|
| |
Provide correct fixups for Thumb2 ADR,
which is _of course_ different from ARM ADR fixups, or any other Thumb2 fixup.
llvm-svn: 121721
|
|
|
|
|
|
|
|
|
|
| |
branch with a null predicate, or
as a "long" direct branch. While the mnemonics are the same, they encode the branch offset differently, and
the Darwin assembler appears to prefer the "long" form for direct branches. Thus, in the name of bitwise
equivalence, provide encoding and fixup support for it.
llvm-svn: 121710
|
|
|
|
| |
llvm-svn: 121709
|
|
|
|
| |
llvm-svn: 121708
|
|
|
|
| |
llvm-svn: 121593
|
|
|
|
| |
llvm-svn: 121587
|
|
|
|
| |
llvm-svn: 121496
|
|
|
|
| |
llvm-svn: 121493
|
|
|
|
|
|
|
|
| |
branches. This is still not perfect,
but it gets many more of them correct than it did previously.
llvm-svn: 121414
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 121404
|
|
|
|
| |
llvm-svn: 121350
|
|
|
|
| |
llvm-svn: 121342
|
|
|
|
|
|
| |
overwritten.
llvm-svn: 121337
|
|
|
|
|
|
|
|
|
|
| |
particular, the immediate has 20-bits of value instead of 21. And bit 0 is '0'
always. Going through the BL fixup encoding was trashing the "bit 0 is '0'"
invariant.
Attempt to get the encoding at slightly more correct with this.
llvm-svn: 121336
|
|
|
|
| |
llvm-svn: 121329
|
|
|
|
| |
llvm-svn: 121308
|
|
|
|
|
|
| |
ordering of thumb mode.
llvm-svn: 121280
|