[llvm] r181222 - [SystemZ] Update non-pic DWARF encodings
Ulrich Weigand
ulrich.weigand at de.ibm.com
Mon May 6 10:28:30 PDT 2013
Author: uweigand
Date: Mon May 6 12:28:30 2013
New Revision: 181222
URL: http://llvm.org/viewvc/llvm-project?rev=181222&view=rev
Log:
[SystemZ] Update non-pic DWARF encodings
As pointed out by Rafael Espindola, we should match the DWARF encodings
produced by GCC in both pic and non-pic modes. This was not the case
for the non-pic case.
This patch changes all DWARF encodings to DW_EH_PE_absptr for the
non-pic case, just like GCC does. The test case is updated to check
for both variants.
Modified:
llvm/trunk/lib/MC/MCObjectFileInfo.cpp
llvm/trunk/test/DebugInfo/SystemZ/eh_frame_personality.ll
Modified: llvm/trunk/lib/MC/MCObjectFileInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectFileInfo.cpp?rev=181222&r1=181221&r2=181222&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCObjectFileInfo.cpp (original)
+++ llvm/trunk/lib/MC/MCObjectFileInfo.cpp Mon May 6 12:28:30 2013
@@ -298,12 +298,19 @@ void MCObjectFileInfo::InitELFMCObjectFi
} else if (T.getArch() == Triple::systemz) {
// All currently-defined code models guarantee that 4-byte PC-relative
// values will be in range.
- PersonalityEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
- dwarf::DW_EH_PE_sdata4;
- LSDAEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
- FDEEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
- TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
- dwarf::DW_EH_PE_sdata4;
+ if (RelocM == Reloc::PIC_) {
+ PersonalityEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
+ dwarf::DW_EH_PE_sdata4;
+ LSDAEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
+ FDEEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
+ TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
+ dwarf::DW_EH_PE_sdata4;
+ } else {
+ PersonalityEncoding = dwarf::DW_EH_PE_absptr;
+ LSDAEncoding = dwarf::DW_EH_PE_absptr;
+ FDEEncoding = dwarf::DW_EH_PE_absptr;
+ TTypeEncoding = dwarf::DW_EH_PE_absptr;
+ }
}
// Solaris requires different flags for .eh_frame to seemingly every other
Modified: llvm/trunk/test/DebugInfo/SystemZ/eh_frame_personality.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/SystemZ/eh_frame_personality.ll?rev=181222&r1=181221&r2=181222&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/SystemZ/eh_frame_personality.ll (original)
+++ llvm/trunk/test/DebugInfo/SystemZ/eh_frame_personality.ll Mon May 6 12:28:30 2013
@@ -1,6 +1,6 @@
; RUN: llc < %s -verify-machineinstrs -mtriple=s390x-linux-gnu | FileCheck -check-prefix=CHECK-FUNC %s
; RUN: llc < %s -verify-machineinstrs -mtriple=s390x-linux-gnu | FileCheck -check-prefix=CHECK-ET %s
-; RUN: llc < %s -verify-machineinstrs -mtriple=s390x-linux-gnu | FileCheck -check-prefix=CHECK-REF %s
+; RUN: llc < %s -verify-machineinstrs -mtriple=s390x-linux-gnu -relocation-model=pic | FileCheck -check-prefix=CHECK-REF %s
declare i32 @__gxx_personality_v0(...)
@@ -18,8 +18,8 @@ clean:
; CHECK-FUNC: foo:
; CHECK-FUNC: .cfi_startproc
-; CHECK-FUNC: .cfi_personality 155, DW.ref.__gxx_personality_v0
-; CHECK-FUNC: .cfi_lsda 27, .Lexception0
+; CHECK-FUNC: .cfi_personality 0, __gxx_personality_v0
+; CHECK-FUNC: .cfi_lsda 0, .Lexception0
; CHECK-FUNC: stmg %r14, %r15, 112(%r15)
; CHECK-FUNC: .cfi_offset %r14, -48
; CHECK-FUNC: .cfi_offset %r15, -40
@@ -33,6 +33,8 @@ clean:
; CHECK-ET-NEXT: GCC_except_table0:
; CHECK-ET-NEXT: .Lexception0:
;
+; CHECK-REF: .cfi_personality 155, DW.ref.__gxx_personality_v0
+; CHECK-REF: .cfi_lsda 27, .Lexception0
; CHECK-REF: .hidden DW.ref.__gxx_personality_v0
; CHECK-REF: .weak DW.ref.__gxx_personality_v0
; CHECK-REF: .section .data.DW.ref.__gxx_personality_v0,"aGw", at progbits,DW.ref.__gxx_personality_v0,comdat
More information about the llvm-commits
mailing list