mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-27 04:18:42 +00:00
The windows buildbot originally failed because the check expressions are evaluated as 64-bit values, even for 32-bit symbols. Fixed this by comparing bottom 32-bits of the expressions. The host/target endian mismatch issue is that it's invalid to read/write target values using a host pointer without taking care of endian differences between the target and host. Most (if not all) instances of reinterpret_cast<uint32_t*>() in the RuntimeDyld are examples of this bug. This has been fixed for Mips using the endian aware read/write functions. The original commits were: r238838: [mips] Add RuntimeDyld tests for currently supported O32 relocations. Reviewers: petarj, vkalintiris Reviewed By: vkalintiris Subscribers: vkalintiris, llvm-commits Differential Revision: http://reviews.llvm.org/D10126 r238844: [mips][mcjit] Add support for R_MIPS_PC32. Summary: This allows us to resolve relocations for DW_EH_PE_pcrel TType encodings in the exception handling LSDA. Also fixed a nearby typo. Reviewers: petarj, vkalintiris Reviewed By: vkalintiris Subscribers: vkalintiris, llvm-commits Differential Revision: http://reviews.llvm.org/D10127 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238915 91177308-0d34-0410-b5e6-96231b3b80d8
51 lines
1.8 KiB
ArmAsm
51 lines
1.8 KiB
ArmAsm
# RUN: llvm-mc -triple=mipsel-unknown-linux -relocation-model=pic -code-model=small -filetype=obj -o %T/test_ELF_O32.o %s
|
|
# RUN: llc -mtriple=mipsel-unknown-linux -relocation-model=pic -filetype=obj -o %T/test_ELF_ExternalFunction_O32.o %S/Inputs/ExternalFunction.ll
|
|
# RUN: llvm-rtdyld -triple=mipsel-unknown-linux -verify -map-section test_ELF_O32.o,.text=0x1000 -map-section test_ELF_ExternalFunction_O32.o,.text=0x10000 -check=%s %T/test_ELF_O32.o %T/test_ELF_ExternalFunction_O32.o
|
|
|
|
# RUN: llvm-mc -triple=mips-unknown-linux -relocation-model=pic -code-model=small -filetype=obj -o %T/test_ELF_O32.o %s
|
|
# RUN: llc -mtriple=mips-unknown-linux -relocation-model=pic -filetype=obj -o %/T/test_ELF_ExternalFunction_O32.o %S/Inputs/ExternalFunction.ll
|
|
# RUN: llvm-rtdyld -triple=mips-unknown-linux -verify -map-section test_ELF_O32.o,.text=0x1000 -map-section test_ELF_ExternalFunction_O32.o,.text=0x10000 -check=%s %T/test_ELF_O32.o %T/test_ELF_ExternalFunction_O32.o
|
|
|
|
.data
|
|
# rtdyld-check: *{4}R_MIPS_32 = foo[31:0]
|
|
R_MIPS_32:
|
|
.word foo
|
|
# rtdyld-check: *{4}(R_MIPS_32+4) = foo[31:0]
|
|
.4byte foo
|
|
# rtdyld-check: *{4}(R_MIPS_PC32) = (foo - R_MIPS_PC32)[31:0]
|
|
R_MIPS_PC32:
|
|
.word foo-.
|
|
# rtdyld-check: *{4}(R_MIPS_PC32 + 4) = (foo - tmp1)[31:0]
|
|
tmp1:
|
|
.4byte foo-tmp1
|
|
|
|
.text
|
|
.abicalls
|
|
.nan legacy
|
|
.text
|
|
.set nomicromips
|
|
.set nomips16
|
|
.set noreorder
|
|
.set nomacro
|
|
.set noat
|
|
|
|
.align 3
|
|
.globl bar
|
|
.type bar,@function
|
|
bar:
|
|
# rtdyld-check: decode_operand(R_MIPS_26, 0)[27:0] = stub_addr(test_ELF_O32.o, .text, foo)[27:0]
|
|
# rtdyld-check: decode_operand(R_MIPS_26, 0)[1:0] = 0
|
|
R_MIPS_26:
|
|
j foo
|
|
nop
|
|
|
|
# rtdyld-check: decode_operand(R_MIPS_HI16, 1)[15:0] = foo[31:16]
|
|
R_MIPS_HI16:
|
|
lui $1, %hi(foo)
|
|
|
|
# rtdyld-check: decode_operand(R_MIPS_LO16, 1)[15:0] = foo[15:0]
|
|
R_MIPS_LO16:
|
|
lui $1, %lo(foo)
|
|
|
|
.size bar, .-bar
|