[llvm] r277732 - [mips] Set Personality and LSDA encoding for FreeBSD
Daniel Sanders via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 4 08:36:04 PDT 2016
Author: dsanders
Date: Thu Aug 4 10:36:03 2016
New Revision: 277732
URL: http://llvm.org/viewvc/llvm-project?rev=277732&view=rev
Log:
[mips] Set Personality and LSDA encoding for FreeBSD
Reviewers: seanbruno, sdardis
Subscribers: tberghammer, danalbert, srhines, dsanders, sdardis, llvm-commits, seanbruno
Differential Revision: https://reviews.llvm.org/D23113
Modified:
llvm/trunk/lib/MC/MCObjectFileInfo.cpp
llvm/trunk/test/CodeGen/Mips/ehframe-indirect.ll
Modified: llvm/trunk/lib/MC/MCObjectFileInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectFileInfo.cpp?rev=277732&r1=277731&r2=277732&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCObjectFileInfo.cpp (original)
+++ llvm/trunk/lib/MC/MCObjectFileInfo.cpp Thu Aug 4 10:36:03 2016
@@ -395,6 +395,14 @@ void MCObjectFileInfo::initELFMCObjectFi
dwarf::DW_EH_PE_sdata4;
// We don't support PC-relative LSDA references in GAS so we use the default
// DW_EH_PE_absptr for those.
+
+ // FreeBSD must be explicit about the data size and using pcrel since it's
+ // assembler/linker won't do the automatic conversion that the Linux tools
+ // do.
+ if (T.isOSFreeBSD()) {
+ PersonalityEncoding |= dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
+ LSDAEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
+ }
break;
case Triple::ppc64:
case Triple::ppc64le:
Modified: llvm/trunk/test/CodeGen/Mips/ehframe-indirect.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/ehframe-indirect.ll?rev=277732&r1=277731&r2=277732&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/ehframe-indirect.ll (original)
+++ llvm/trunk/test/CodeGen/Mips/ehframe-indirect.ll Thu Aug 4 10:36:03 2016
@@ -1,15 +1,34 @@
-; RUN: llc -mtriple=mipsel-linux-gnu < %s -asm-verbose -relocation-model=pic | FileCheck -check-prefixes=ALL,O32 %s
-; RUN: llc -mtriple=mipsel-linux-android < %s -asm-verbose -relocation-model=pic | FileCheck -check-prefixes=ALL,O32 %s
-; RUN: llc -mtriple=mips64el-linux-gnu -target-abi=n32 < %s -asm-verbose -relocation-model=pic | FileCheck -check-prefixes=ALL,N32 %s
-; RUN: llc -mtriple=mips64el-linux-android -target-abi=n32 < %s -asm-verbose -relocation-model=pic | FileCheck -check-prefixes=ALL,N32 %s
-; RUN: llc -mtriple=mips64el-linux-gnu < %s -asm-verbose -relocation-model=pic | FileCheck -check-prefixes=ALL,N64 %s
-; RUN: llc -mtriple=mips64el-linux-android < %s -asm-verbose -relocation-model=pic | FileCheck -check-prefixes=ALL,N64 %s
+; RUN: llc -mtriple=mipsel-linux-gnu < %s -asm-verbose -relocation-model=pic | \
+; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-O32,O32 %s
+; RUN: llc -mtriple=mipsel-linux-android < %s -asm-verbose -relocation-model=pic | \
+; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-O32,O32 %s
+; RUN: llc -mtriple=mips64el-linux-gnu -target-abi=n32 < %s -asm-verbose -relocation-model=pic | \
+; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-N32,N32 %s
+; RUN: llc -mtriple=mips64el-linux-android -target-abi=n32 < %s -asm-verbose -relocation-model=pic | \
+; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-N32,N32 %s
+; RUN: llc -mtriple=mips64el-linux-gnu < %s -asm-verbose -relocation-model=pic | \
+; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-N64,N64 %s
+; RUN: llc -mtriple=mips64el-linux-android < %s -asm-verbose -relocation-model=pic | \
+; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-N64,N64 %s
+; RUN: llc -mtriple=mips64el-linux-gnu < %s -asm-verbose -relocation-model=pic | \
+; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-N64,N64 %s
+; RUN: llc -mtriple=mips64-unknown-freebsd11.0 < %s -asm-verbose -relocation-model=pic | \
+; RUN: FileCheck -check-prefixes=ALL,FREEBSD,FREEBSD-N64,N64 %s
@_ZTISt9exception = external constant i8*
define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
; ALL: .cfi_startproc
-; ALL: .cfi_personality 128, DW.ref.__gxx_personality_v0
+
+; Linux must rely on the assembler/linker converting the encodings.
+; LINUX: .cfi_personality 128, DW.ref.__gxx_personality_v0
+; LINUX-O32: .cfi_lsda 0, $exception0
+; LINUX-NEW: .cfi_lsda 0, .Lexception0
+
+; FreeBSD can (and must) be more direct about the encodings it wants.
+; FREEBSD: .cfi_personality 155, DW.ref.__gxx_personality_v0
+; FREEBSD-O32: .cfi_lsda 27, $exception0
+; FREEBSD-NEW: .cfi_lsda 27, .Lexception0
entry:
invoke void @foo() to label %cont unwind label %lpad
More information about the llvm-commits
mailing list