Skip to content

Commit 8f75063

Browse files
chenx97MingcongBai
authored andcommitted
Revert "[mips] Use pc-relative relocations in .eh_frame"
This reverts commit 342ae04.
1 parent 081bc7e commit 8f75063

File tree

18 files changed

+51
-114
lines changed

18 files changed

+51
-114
lines changed

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ CODEGENOPT(ForceDwarfFrameSection , 1, 0) ///< Set when -fforce-dwarf-frame is
118118
///< Set when -femit-compact-unwind-non-canonical is enabled.
119119
CODEGENOPT(EmitCompactUnwindNonCanonical, 1, 0)
120120

121-
///< Set when -mips-pc64-rel is enabled.
122-
CODEGENOPT(MipsPC64Relocation, 1, 0)
123-
124121
///< Set when -femit-dwarf-unwind is passed.
125122
ENUM_CODEGENOPT(EmitDwarfUnwind, llvm::EmitDwarfUnwindType, 2,
126123
llvm::EmitDwarfUnwindType::Default)

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4351,9 +4351,6 @@ def mno_relax_pic_calls : Flag<["-"], "mno-relax-pic-calls">,
43514351
Group<m_mips_Features_Group>,
43524352
HelpText<"Do not produce relaxation hints for linkers to try optimizing PIC "
43534353
"call sequences into direct calls (MIPS only)">, Flags<[HelpHidden]>;
4354-
defm mips_pc64_rel : BoolOption<"", "mips-pc64-rel",
4355-
CodeGenOpts<"MipsPC64Relocation">, DefaultTrue,
4356-
PosFlag<SetTrue, [CC1Option, CC1AsOption], "Use MIPS 64-bit PC-relative relocations">, NegFlag<SetFalse>>;
43574354
def mglibc : Flag<["-"], "mglibc">, Group<m_libc_Group>, Flags<[HelpHidden]>;
43584355
def muclibc : Flag<["-"], "muclibc">, Group<m_libc_Group>, Flags<[HelpHidden]>;
43594356
def module_file_info : Flag<["-"], "module-file-info">, Flags<[NoXarchOption,CC1Option]>, Group<Action_Group>,

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ static bool initTargetOptions(DiagnosticsEngine &Diags,
486486
Options.MCOptions.CommandLineArgs = CodeGenOpts.CommandLineArgs;
487487
Options.MCOptions.AsSecureLogFile = CodeGenOpts.AsSecureLogFile;
488488
Options.MisExpect = CodeGenOpts.MisExpect;
489-
Options.MCOptions.MipsPC64Relocation = CodeGenOpts.MipsPC64Relocation;
490489

491490
return true;
492491
}

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,16 +2013,6 @@ void Clang::AddMIPSTargetArgs(const ArgList &Args,
20132013
CmdArgs.push_back("-mips-jalr-reloc=0");
20142014
}
20152015
}
2016-
2017-
if (Arg *A = Args.getLastArg(options::OPT_mips_pc64_rel,
2018-
options::OPT_no_mips_pc64_rel)) {
2019-
CmdArgs.push_back("-mllvm");
2020-
if (A->getOption().matches(options::OPT_mips_pc64_rel))
2021-
CmdArgs.push_back("-mips-pc64-rel=true");
2022-
else
2023-
CmdArgs.push_back("-mips-pc64-rel=false");
2024-
A->claim();
2025-
}
20262016
}
20272017

20282018
void Clang::AddPPCTargetArgs(const ArgList &Args,

clang/test/Driver/mips-features.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -456,15 +456,3 @@
456456
// RUN: -mrelax-pic-calls -mno-relax-pic-calls 2>&1 \
457457
// RUN: | FileCheck --check-prefix=CHECK-NO-RELAX-PIC-CALLS %s
458458
// CHECK-NO-RELAX-PIC-CALLS: "-mllvm" "-mips-jalr-reloc=0"
459-
//
460-
// -mips-pc64-rel
461-
// RUN: %clang -target mips-unknown-linux-gnu -### -c %s \
462-
// RUN: -no-mips-pc64-rel -mips-pc64-rel 2>&1 \
463-
// RUN: | FileCheck --check-prefix=CHECK-PC64-REL %s
464-
// CHECK-PC64-REL-NOT: "-mllvm" "-mips-pc64-rel=false"
465-
//
466-
// -no-mips-pc64-rel
467-
// RUN: %clang -target mips-unknown-linux-gnu -### -c %s \
468-
// RUN: -mips-pc64-rel -no-mips-pc64-rel 2>&1 \
469-
// RUN: | FileCheck --check-prefix=CHECK-NO-PC64-REL %s
470-
// CHECK-NO-PC64-REL: "-mllvm" "-mips-pc64-rel=false"

clang/tools/driver/cc1as_main.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ struct AssemblerInvocation {
147147
// Note: maybe overriden by other constraints.
148148
unsigned EmitCompactUnwindNonCanonical : 1;
149149

150-
unsigned MipsPC64Relocation : 1;
151-
152150
/// The name of the relocation model to use.
153151
std::string RelocationModel;
154152

@@ -413,7 +411,6 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
413411
MCTargetOptions MCOptions;
414412
MCOptions.EmitDwarfUnwind = Opts.EmitDwarfUnwind;
415413
MCOptions.EmitCompactUnwindNonCanonical = Opts.EmitCompactUnwindNonCanonical;
416-
MCOptions.MipsPC64Relocation = Opts.MipsPC64Relocation;
417414
MCOptions.AsSecureLogFile = Opts.AsSecureLogFile;
418415

419416
std::unique_ptr<MCAsmInfo> MAI(

lld/test/ELF/mips-eh_frame-pic.s

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
## relative addressing.
1313
# NOPIC-ERR: ld.lld: error: relocation R_MIPS_64 cannot be used against local symbol
1414

15-
## For -fPIC, .eh_frame should contain DW_EH_PE_pcrel | DW_EH_PE_sdata8 values:
15+
## For -fPIC, .eh_frame should contain DW_EH_PE_pcrel | DW_EH_PE_sdata4 values:
1616
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux --position-independent %s -o %t-pic.o
1717
# RUN: llvm-readobj -r %t-pic.o | FileCheck %s --check-prefixes=RELOCS,PIC64-RELOCS
1818
# RUN: ld.lld -shared %t-pic.o -o %t-pic.so
19-
# RUN: llvm-dwarfdump --eh-frame %t-pic.so | FileCheck %s --check-prefix=PIC64-EH-FRAME
19+
# RUN: llvm-dwarfdump --eh-frame %t-pic.so | FileCheck %s --check-prefix=PIC-EH-FRAME
2020

2121
## Also check MIPS32:
2222
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t-nopic32.o
@@ -31,23 +31,23 @@
3131
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux --position-independent %s -o %t-pic32.o
3232
# RUN: llvm-readobj -r %t-pic32.o | FileCheck %s --check-prefixes=RELOCS,PIC32-RELOCS
3333
# RUN: ld.lld -shared %t-pic32.o -o %t-pic32.so
34-
# RUN: llvm-dwarfdump --eh-frame %t-pic32.so | FileCheck %s --check-prefix=PIC32-EH-FRAME
34+
# RUN: llvm-dwarfdump --eh-frame %t-pic32.so | FileCheck %s --check-prefix=PIC-EH-FRAME
3535

3636
# RELOCS: .rel{{a?}}.eh_frame {
3737
# ABS32-RELOCS-NEXT: 0x1C R_MIPS_32 .text
3838
# ABS64-RELOCS-NEXT: 0x1C R_MIPS_64/R_MIPS_NONE/R_MIPS_NONE .text
39-
# PIC64-RELOCS-NEXT: 0x1C R_MIPS_PC32/R_MIPS_64/R_MIPS_NONE <null>
39+
# PIC64-RELOCS-NEXT: 0x1C R_MIPS_PC32/R_MIPS_NONE/R_MIPS_NONE <null>
4040
# PIC32-RELOCS-NEXT: 0x1C R_MIPS_PC32 <null>
4141
# RELOCS-NEXT: }
4242

4343
# ABS64-EH-FRAME: Augmentation data: 0C
4444
## ^^ fde pointer encoding: DW_EH_PE_sdata8
4545
# ABS32-EH-FRAME: Augmentation data: 0B
4646
## ^^ fde pointer encoding: DW_EH_PE_sdata4
47-
# PIC32-EH-FRAME: Augmentation data: 1B
48-
## ^^ fde pointer encoding: DW_EH_PE_pcrel | DW_EH_PE_sdata4
49-
# PIC64-EH-FRAME: Augmentation data: 1C
50-
## ^^ fde pointer encoding: DW_EH_PE_pcrel | DW_EH_PE_sdata8
47+
# PIC-EH-FRAME: Augmentation data: 1B
48+
## ^^ fde pointer encoding: DW_EH_PE_pcrel | DW_EH_PE_sdata4
49+
## Note: ld.bfd converts the R_MIPS_64 relocs to DW_EH_PE_pcrel | DW_EH_PE_sdata8
50+
## for N64 ABI (and DW_EH_PE_pcrel | DW_EH_PE_sdata4 for MIPS32)
5151

5252
.ent func
5353
.global func

llvm/include/llvm/MC/MCContext.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,6 @@ class MCContext {
791791
unsigned getGenDwarfFileNumber() { return GenDwarfFileNumber; }
792792
EmitDwarfUnwindType emitDwarfUnwindInfo() const;
793793
bool emitCompactUnwindNonCanonical() const;
794-
bool getMipsPC64Relocation() const;
795794

796795
void setGenDwarfFileNumber(unsigned FileNumber) {
797796
GenDwarfFileNumber = FileNumber;

llvm/include/llvm/MC/MCTargetOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ class MCTargetOptions {
8989
// functions on Darwins.
9090
bool EmitCompactUnwindNonCanonical : 1;
9191

92-
// Whether to use MIPS 64-bit PC-relative relocations
93-
bool MipsPC64Relocation : 1;
94-
9592
MCTargetOptions();
9693

9794
/// getABIName - If this returns a non-empty string this represents the

llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ std::string getABIName();
5151

5252
std::string getAsSecureLogFile();
5353

54-
bool getMipsPC64Relocation();
55-
5654
/// Create this object with static storage to register mc-related command
5755
/// line options.
5856
struct RegisterMCTargetOptionsFlags {

llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,19 @@ void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx,
208208
// that the eh_frame section can be read-only. DW.ref.personality will be
209209
// generated for relocation.
210210
PersonalityEncoding = dwarf::DW_EH_PE_indirect;
211+
// The N64 ABI probably ought to use DW_EH_PE_sdata8 so we detect
212+
// pointer size here.
211213
static const auto Sdata = TgtM.getProgramPointerSize() < sizeof(uint64_t)
212214
? dwarf::DW_EH_PE_sdata4
213215
: dwarf::DW_EH_PE_sdata8;
214216
TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | Sdata;
217+
// We don't support PC-relative LSDA references in GAS so we use the default
218+
// DW_EH_PE_absptr for those.
215219

216-
if (isPositionIndependent() &&
217-
(TgtM.Options.MCOptions.MipsPC64Relocation || TgtM.getTargetTriple().isMIPS32())) {
220+
// FreeBSD must be explicit about the data size and using pcrel since it's
221+
// assembler/linker won't do the automatic conversion that the Linux tools
222+
// do.
223+
if (TgtM.getTargetTriple().isOSFreeBSD()) {
218224
PersonalityEncoding |= dwarf::DW_EH_PE_pcrel | Sdata;
219225
LSDAEncoding = dwarf::DW_EH_PE_pcrel | Sdata;
220226
}

llvm/lib/MC/MCContext.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -932,12 +932,6 @@ bool MCContext::emitCompactUnwindNonCanonical() const {
932932
return false;
933933
}
934934

935-
bool MCContext::getMipsPC64Relocation() const {
936-
if (TargetOptions)
937-
return TargetOptions->MipsPC64Relocation;
938-
return false;
939-
}
940-
941935
void MCContext::setGenDwarfRootFile(StringRef InputFileName, StringRef Buffer) {
942936
// MCDwarf needs the root file as well as the compilation directory.
943937
// If we find a '.file 0' directive that will supersede these values.

llvm/lib/MC/MCObjectFileInfo.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,14 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T, bool Large) {
337337
case Triple::mipsel:
338338
case Triple::mips64:
339339
case Triple::mips64el:
340-
FDECFIEncoding = Ctx->getAsmInfo()->getCodePointerSize() == 4
341-
? dwarf::DW_EH_PE_sdata4
342-
: dwarf::DW_EH_PE_sdata8;
343-
if (PositionIndependent && (Ctx->getMipsPC64Relocation() || T.isMIPS32()))
344-
FDECFIEncoding |= dwarf::DW_EH_PE_pcrel;
340+
// We cannot use DW_EH_PE_sdata8 for the large PositionIndependent case
341+
// since there is no R_MIPS_PC64 relocation (only a 32-bit version).
342+
if (PositionIndependent && !Large)
343+
FDECFIEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
344+
else
345+
FDECFIEncoding = Ctx->getAsmInfo()->getCodePointerSize() == 4
346+
? dwarf::DW_EH_PE_sdata4
347+
: dwarf::DW_EH_PE_sdata8;
345348
break;
346349
case Triple::ppc64:
347350
case Triple::ppc64le:

llvm/lib/MC/MCTargetOptions.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ MCTargetOptions::MCTargetOptions()
1919
PreserveAsmComments(true), Dwarf64(false),
2020
EmitDwarfUnwind(EmitDwarfUnwindType::Default),
2121
MCUseDwarfDirectory(DefaultDwarfDirectory),
22-
EmitCompactUnwindNonCanonical(false),
23-
MipsPC64Relocation(true) {}
22+
EmitCompactUnwindNonCanonical(false) {}
2423

2524
StringRef MCTargetOptions::getABIName() const {
2625
return ABIName;

llvm/lib/MC/MCTargetOptionsCommandFlags.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ MCOPT(bool, NoDeprecatedWarn)
4747
MCOPT(bool, NoTypeCheck)
4848
MCOPT(std::string, ABIName)
4949
MCOPT(std::string, AsSecureLogFile)
50-
MCOPT(bool, MipsPC64Relocation)
5150

5251
llvm::mc::RegisterMCTargetOptionsFlags::RegisterMCTargetOptionsFlags() {
5352
#define MCBINDOPT(NAME) \
@@ -129,13 +128,6 @@ llvm::mc::RegisterMCTargetOptionsFlags::RegisterMCTargetOptionsFlags() {
129128
"as-secure-log-file", cl::desc("As secure log file name"), cl::Hidden);
130129
MCBINDOPT(AsSecureLogFile);
131130

132-
static cl::opt<bool> MipsPC64Relocation(
133-
"mips-pc64-rel", cl::Hidden,
134-
cl::desc(
135-
"Whether to MIPS 64-bit PC-relative relocations"),
136-
cl::init(true));
137-
MCBINDOPT(MipsPC64Relocation);
138-
139131
#undef MCBINDOPT
140132
}
141133

@@ -154,7 +146,6 @@ MCTargetOptions llvm::mc::InitMCTargetOptionsFromFlags() {
154146
Options.EmitDwarfUnwind = getEmitDwarfUnwind();
155147
Options.EmitCompactUnwindNonCanonical = getEmitCompactUnwindNonCanonical();
156148
Options.AsSecureLogFile = getAsSecureLogFile();
157-
Options.MipsPC64Relocation = getMipsPC64Relocation();
158149

159150
return Options;
160151
}

llvm/test/CodeGen/Mips/ehframe-indirect.ll

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,30 @@
11
; RUN: llc -mtriple=mipsel-linux-gnu < %s -asm-verbose -relocation-model=pic | \
22
; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-O32,O32 %s
3-
; RUN: llc -mtriple=mipsel-linux-android < %s -asm-verbose -relocation-model=pic | \
4-
; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-O32,O32 %s
53
; RUN: llc -mtriple=mips64el-linux-gnu -target-abi=n32 < %s -asm-verbose -relocation-model=pic | \
6-
; RUN: FileCheck -check-prefixes=ALL,N32,N32REL %s
4+
; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-NEW,N32 %s
75
; RUN: llc -mtriple=mips64el-linux-gnu < %s -asm-verbose -relocation-model=pic | \
8-
; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-NEW,N64,N64REL %s
9-
; RUN: llc -mtriple=mips64el-linux-android < %s -asm-verbose -relocation-model=pic | \
10-
; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-NEW,N64,N64REL %s
6+
; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-NEW,N64 %s
117
; RUN: llc -mtriple=mips64el-linux-gnu < %s -asm-verbose -relocation-model=pic | \
12-
; RUN: FileCheck -check-prefixes=ALL,N64,N64REL %s
8+
; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-NEW,N64 %s
9+
; RUN: llc -mtriple=mips-unknown-freebsd11.0 < %s -asm-verbose -relocation-model=pic | \
10+
; RUN: FileCheck -check-prefixes=ALL,FREEBSD,FREEBSD-O32,O32 %s
1311
; RUN: llc -mtriple=mips64-unknown-freebsd11.0 < %s -asm-verbose -relocation-model=pic | \
14-
; RUN: FileCheck -check-prefixes=ALL,N64,N64REL %s
15-
16-
; RUN: llc -mtriple=mips64-linux-gnu -target-abi=n32 -mips-pc64-rel=false \
17-
; RUN: -asm-verbose -relocation-model=pic < %s | \
18-
; RUN: FileCheck -check-prefixes=ALL,N32,N32ABS %s
19-
; RUN: llc -mtriple=mips64-linux-gnu -mips-pc64-rel=false \
20-
; RUN: -asm-verbose -relocation-model=pic < %s | \
21-
; RUN: FileCheck -check-prefixes=ALL,N64,N64ABS %s
12+
; RUN: FileCheck -check-prefixes=ALL,FREEBSD,FREEBSD-NEW,N64 %s
2213

2314
@_ZTISt9exception = external constant ptr
2415

2516
define i32 @main() personality ptr @__gxx_personality_v0 {
2617
; ALL: .cfi_startproc
2718

28-
; O32: .cfi_personality 155, DW.ref.__gxx_personality_v0
29-
; O32: .cfi_lsda 27, $exception0
30-
; N32REL: .cfi_personality 155, DW.ref.__gxx_personality_v0
31-
; N32REL: .cfi_lsda 27, .Lexception0
32-
; N32ABS: .cfi_personality 128, DW.ref.__gxx_personality_v0
33-
; N32ABS: .cfi_lsda 0, .Lexception0
34-
; N64REL: .cfi_personality 155, DW.ref.__gxx_personality_v0
35-
; N64REL: .cfi_lsda 27, .Lexception0
36-
; N64ABS: .cfi_personality 128, DW.ref.__gxx_personality_v0
37-
; N64ABS: .cfi_lsda 0, .Lexception0
19+
; Linux must rely on the assembler/linker converting the encodings.
20+
; LINUX: .cfi_personality 128, DW.ref.__gxx_personality_v0
21+
; LINUX-O32: .cfi_lsda 0, $exception0
22+
; LINUX-NEW: .cfi_lsda 0, .Lexception0
23+
24+
; FreeBSD can (and must) be more direct about the encodings it wants.
25+
; FREEBSD: .cfi_personality 155, DW.ref.__gxx_personality_v0
26+
; FREEBSD-O32: .cfi_lsda 27, $exception0
27+
; FREEBSD-NEW: .cfi_lsda 27, .Lexception0
3828

3929
entry:
4030
invoke void @foo() to label %cont unwind label %lpad

llvm/test/DebugInfo/Mips/eh_frame.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
; STATIC-DAG: R_MIPS_32 00000000 .gcc_except_table
1818

1919
; PIC-LABEL: Relocation section '.rel.eh_frame'
20-
; PIC-DAG: R_MIPS_PC32 00000000 DW.ref.__gxx_personality_v0
21-
; PIC-DAG: R_MIPS_PC32
20+
; PIC-DAG: R_MIPS_32 00000000 DW.ref.__gxx_personality_v0
2221
; PIC-DAG: R_MIPS_PC32
22+
; PIC-DAG: R_MIPS_32 00000000 .gcc_except_table
2323

2424
; CHECK-READELF: DW.ref.__gxx_personality_v0
2525
; CHECK-READELF-STATIC-NEXT: R_MIPS_32 00000000 .text

llvm/test/MC/Mips/eh-frame.s

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,14 @@
3333
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,PIC64 %s
3434
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_PIC %s
3535

36+
/// However using the large code model forces R_MIPS_64 since there is no R_MIPS_PC64 relocation:
3637
// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64-unknown-linux-gnu --position-independent --large-code-model
37-
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,PIC64 %s
38-
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_PIC %s
38+
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,ABS64 %s
39+
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_ABS %s
3940

4041
// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64el-unknown-linux-gnu --position-independent --large-code-model
41-
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,PIC64 %s
42-
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_PIC %s
43-
44-
// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64-unknown-linux-gnu \
45-
// RUN: --position-independent --large-code-model -mips-pc64-rel=false
46-
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,OLD64 %s
47-
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_OLD %s
42+
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,ABS64 %s
43+
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_ABS %s
4844

4945
func:
5046
.cfi_startproc
@@ -55,8 +51,7 @@ func:
5551
// ABS32-NEXT: R_MIPS_32
5652
// ABS64-NEXT: R_MIPS_64/R_MIPS_NONE/R_MIPS_NONE
5753
// PIC32-NEXT: R_MIPS_PC32
58-
// PIC64-NEXT: R_MIPS_PC32/R_MIPS_64/R_MIPS_NONE
59-
// OLD64-NEXT: R_MIPS_64/R_MIPS_NONE/R_MIPS_NONE
54+
// PIC64-NEXT: R_MIPS_PC32/R_MIPS_NONE/R_MIPS_NONE
6055
// RELOCS-NEXT: }
6156

6257
// DWARF32: 00000000 00000010 00000000 CIE
@@ -92,17 +87,14 @@ func:
9287
// DWARF64-NEXT: Return address column: 31
9388
// DWARF64_ABS-NEXT: Augmentation data: 0C
9489
// ^^ fde pointer encoding: DW_EH_PE_sdata8
95-
// DWARF64_PIC: Augmentation data: 1C
96-
// ^^ fde pointer encoding: DW_EH_PE_pcrel | DW_EH_PE_sdata8
97-
// DWARF64_OLD: Augmentation data: 0C
98-
// ^^ fde pointer encoding: DW_EH_PE_sdata8
90+
// DWARF64_PIC: Augmentation data: 1B
91+
// ^^ fde pointer encoding: DW_EH_PE_pcrel | DW_EH_PE_sdata4
9992
// DWARF64-EMPTY:
10093
// DWARF64-NEXT: DW_CFA_def_cfa_register: SP_64
10194
// DWARF64_PIC-NEXT: DW_CFA_nop:
10295
//
10396
// DWARF64_ABS: 00000014 00000018 00000018 FDE cie=00000000 pc=00000000...00000000
104-
// DWARF64_PIC: 00000014 00000018 00000018 FDE cie=00000000 pc=0000001c...0000001c
105-
// DWARF64_OLD: 00000014 00000018 00000018 FDE cie=00000000 pc=00000000...00000000
97+
// DWARF64_PIC: 00000014 00000010 00000018 FDE cie=00000000 pc=00000000...00000000
10698
// DWARF64-NEXT: Format: DWARF32
10799
// DWARF64-NEXT: DW_CFA_nop:
108100
// DWARF64-NEXT: DW_CFA_nop:

0 commit comments

Comments
 (0)