Skip to content

Commit 095f083

Browse files
authored
Merge branch 'main' into main
2 parents 0fa1659 + 0813c5c commit 095f083

File tree

13 files changed

+269
-270
lines changed

13 files changed

+269
-270
lines changed

bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
244244
Inst.clear();
245245
Inst.addOperand(MCOperand::createExpr(RISCVMCExpr::create(
246246
MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *Ctx),
247-
RISCVMCExpr::VK_RISCV_CALL, *Ctx)));
247+
RISCVMCExpr::VK_CALL, *Ctx)));
248248
}
249249

250250
void createCall(MCInst &Inst, const MCSymbol *Target,
@@ -434,19 +434,19 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
434434
case ELF::R_RISCV_TLS_GOT_HI20:
435435
// The GOT is reused so no need to create GOT relocations
436436
case ELF::R_RISCV_PCREL_HI20:
437-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_RISCV_PCREL_HI, Ctx);
437+
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_PCREL_HI, Ctx);
438438
case ELF::R_RISCV_PCREL_LO12_I:
439439
case ELF::R_RISCV_PCREL_LO12_S:
440-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_RISCV_PCREL_LO, Ctx);
440+
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_PCREL_LO, Ctx);
441441
case ELF::R_RISCV_HI20:
442-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_RISCV_HI, Ctx);
442+
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_HI, Ctx);
443443
case ELF::R_RISCV_LO12_I:
444444
case ELF::R_RISCV_LO12_S:
445-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_RISCV_LO, Ctx);
445+
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_LO, Ctx);
446446
case ELF::R_RISCV_CALL:
447-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_RISCV_CALL, Ctx);
447+
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_CALL, Ctx);
448448
case ELF::R_RISCV_CALL_PLT:
449-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_RISCV_CALL_PLT, Ctx);
449+
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_CALL_PLT, Ctx);
450450
}
451451
}
452452

@@ -471,8 +471,8 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
471471
switch (cast<RISCVMCExpr>(ImmExpr)->getKind()) {
472472
default:
473473
return false;
474-
case RISCVMCExpr::VK_RISCV_CALL:
475-
case RISCVMCExpr::VK_RISCV_CALL_PLT:
474+
case RISCVMCExpr::VK_CALL:
475+
case RISCVMCExpr::VK_CALL_PLT:
476476
return true;
477477
}
478478
}

llvm/docs/CommandGuide/llvm-strip.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ multiple file formats.
3737

3838
.. option:: --discard-all, -x
3939

40-
Remove most local symbols from the output. Different file formats may limit
41-
this to a subset of the local symbols. For example, file and section symbols in
42-
ELF objects will not be discarded. Additionally, remove all debug sections.
40+
Remove most local symbols not referenced by relocations from the output.
41+
Different file formats may limit this to a subset of the local symbols. For
42+
example, file and section symbols in ELF objects will not be discarded.
43+
Additionally, remove all debug sections.
4344

4445
.. option:: --enable-deterministic-archives, -D
4546

@@ -152,7 +153,7 @@ them.
152153

153154
.. option:: --discard-locals, -X
154155

155-
Remove local symbols starting with ".L" from the output.
156+
Remove local symbols starting with ".L" not referenced by relocations from the output.
156157

157158
.. option:: --keep-file-symbols
158159

llvm/docs/ReleaseNotes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ Changes to the LLVM tools
169169

170170
* llvm-objcopy now supports the `--update-section` flag for intermediate Mach-O object files.
171171
* llvm-strip now supports continuing to process files on encountering an error.
172-
* In llvm-objcopy's ELF port, `--discard-locals` and `--discard-all` now allow and preserve symbols referenced by relocations.
172+
* In llvm-objcopy/llvm-strip's ELF port, `--discard-locals` and `--discard-all` now allow and preserve symbols referenced by relocations.
173+
([#47468](https://github.com/llvm/llvm-project/issues/47468))
173174

174175
Changes to LLDB
175176
---------------------------------

llvm/lib/MC/MCExpr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ bool MCExpr::evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
286286
}
287287

288288
bool IsRelocatable = evaluateAsRelocatableImpl(Value, Asm, Addrs, InSet);
289-
Res = Value.getConstant(); // Value with RefKind (e.g. %hi(0xdeadbeef) in
290-
// MIPS) is not considered
289+
Res = Value.getConstant();
290+
// Value with RefKind (e.g. %hi(0xdeadbeef) in MIPS) is not considered
291291
// absolute (the value is unknown at parse time), even if it might be resolved
292292
// by evaluateFixup.
293293
return IsRelocatable && Value.isAbsolute() && Value.getRefKind() == 0;

0 commit comments

Comments
 (0)