Skip to content

Commit d27799a

Browse files
committed
Update for review feedback.
1 parent 3626594 commit d27799a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

lld/ELF/Relocations.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ class RelocationScanner {
457457
Ctx &ctx;
458458
InputSectionBase *sec;
459459
OffsetGetter getter;
460-
StringRef rv_vendor = "";
460+
StringRef rvVendor;
461461

462462
// End of relocations, used by Mips/PPC64.
463463
const void *end = nullptr;
@@ -1514,7 +1514,7 @@ void RelocationScanner::scanOne(typename Relocs<RelTy>::const_iterator &i) {
15141514

15151515
// Stash the RISCV vendor namespace for the subsequent relocation.
15161516
if (LLVM_UNLIKELY(ctx.arg.emachine == EM_RISCV && type == R_RISCV_VENDOR)) {
1517-
rv_vendor = sym.getName();
1517+
rvVendor = sym.getName();
15181518
return;
15191519
}
15201520

@@ -1524,11 +1524,11 @@ void RelocationScanner::scanOne(typename Relocs<RelTy>::const_iterator &i) {
15241524
return;
15251525

15261526
RelExpr expr;
1527-
if (LLVM_LIKELY(rv_vendor.empty())) {
1527+
if (LLVM_LIKELY(rvVendor.empty())) {
15281528
expr = ctx.target->getRelExpr(type, sym, sec->content().data() + offset);
15291529
} else {
15301530
expr = ctx.target->getVendorRelExpr(
1531-
type, sym, sec->content().data() + offset, rv_vendor);
1531+
type, sym, sec->content().data() + offset, rvVendor);
15321532
}
15331533
int64_t addend = RelTy::HasAddend
15341534
? getAddend<ELFT>(rel)
@@ -1540,7 +1540,7 @@ void RelocationScanner::scanOne(typename Relocs<RelTy>::const_iterator &i) {
15401540
addend += getPPC64TocBase(ctx);
15411541

15421542
// A RISCV vendor namespace only applies to a single relocation.
1543-
rv_vendor = "";
1543+
rvVendor = "";
15441544

15451545
// Ignore R_*_NONE and other marker relocations.
15461546
if (expr == R_NONE)

lld/test/ELF/riscv-vendor-relocations.s

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44
.option exact
55

66
qc.e.bgeui s0, 20, TARGET
7-
# CHECK: unknown vendor-specific relocation (193) in vendor namespace "QUALCOMM" against symbol TARGET
7+
# CHECK: error: {{.*}} unknown vendor-specific relocation (193) in vendor namespace "QUALCOMM" against symbol TARGET
88

99
.global QUALCOMM
1010
QUALCOMM:
1111
nop
1212

1313
qc.e.bgeui s0, 20, TARGET
14-
# CHECK: unknown vendor-specific relocation (193) in vendor namespace "QUALCOMM" against symbol TARGET
14+
# CHECK: error: {{.*}} unknown vendor-specific relocation (193) in vendor namespace "QUALCOMM" against symbol TARGET
1515

1616
nds.bbc t0, 7, TARGET
17-
# CHECK: unknown vendor-specific relocation (241) in vendor namespace "ANDES" against symbol TARGET
17+
# CHECK: error: {{.*}} unknown vendor-specific relocation (241) in vendor namespace "ANDES" against symbol TARGET
1818

1919
.global ANDES
2020
ANDES:
2121
nop
2222

2323
nds.bbs t0, 7, TARGET
24-
# CHECK: unknown vendor-specific relocation (241) in vendor namespace "ANDES" against symbol TARGET
24+
# CHECK: error: {{.*}} unknown vendor-specific relocation (241) in vendor namespace "ANDES" against symbol TARGET
2525

2626
.global TARGET
2727
TARGET:

0 commit comments

Comments
 (0)