forked from OSchip/llvm-project
[AVR] Don't adjust addresses by 2 for absolute values
Adjusting by 2 breaks DWARF output. With this fix, programs start to compile and produce valid DWARF output. Differential Revision: https://reviews.llvm.org/D74213
This commit is contained in:
parent
56f7de5baa
commit
165f707f9d
|
@ -244,8 +244,18 @@ void AVRAsmBackend::adjustFixupValue(const MCFixup &Fixup,
|
|||
// To handle both cases, we simply un-adjust the temporary label
|
||||
// case so it acts like all other labels.
|
||||
if (const MCSymbolRefExpr *A = Target.getSymA()) {
|
||||
if (A->getSymbol().isTemporary())
|
||||
Value += 2;
|
||||
if (A->getSymbol().isTemporary()) {
|
||||
switch (Kind) {
|
||||
case FK_Data_1:
|
||||
case FK_Data_2:
|
||||
case FK_Data_4:
|
||||
case FK_Data_8:
|
||||
// Don't shift value for absolute addresses.
|
||||
break;
|
||||
default:
|
||||
Value += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (Kind) {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
; RUN: llvm-mc -filetype=obj -triple=avr %s | llvm-objdump -dr - | FileCheck %s
|
||||
|
||||
; CHECK: bar:
|
||||
; CHECK-NEXT: 00 00 nop
|
||||
; CHECK-NEXT: R_AVR_16 .text+0x2
|
||||
bar:
|
||||
.short 1f
|
||||
1:
|
Loading…
Reference in New Issue