Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fbcfbd9

Browse files
committed
[NFC][ELF] Fix overzealous find/replace affecting comments
Commit a94060c ("[ELF] Pass Ctx & to Relocations") swapped the InputSectionBase &c argument for an InputSectionBase *sec member, and so "c." was replaced with "sec->". However, this must have done in such a way that "Local-Exec." was transformed to "Local-Exesec->" and "RISCV::relocateAlloc." to "RISCV::relocateAllosec->", i.e. without the use of something like clangd, and without appropriate word boundaries in a regex.
1 parent 65b4099 commit fbcfbd9

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

lld/ELF/Relocations.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,8 +1212,7 @@ unsigned RelocScan::handleTlsRelocation(RelExpr expr, RelType type,
12121212
!sec->file->ppc64DisableTLSRelax;
12131213

12141214
// If we are producing an executable and the symbol is non-preemptable, it
1215-
// must be defined and the code sequence can be optimized to use
1216-
// Local-Exesec->
1215+
// must be defined and the code sequence can be optimized to use Local-Exec.
12171216
//
12181217
// ARM and RISC-V do not support any relaxations for TLS relocations, however,
12191218
// we can omit the DTPMOD dynamic relocations and resolve them at link time
@@ -1226,7 +1225,7 @@ unsigned RelocScan::handleTlsRelocation(RelExpr expr, RelType type,
12261225
// module index, with a special value of 0 for the current module. GOT[e1] is
12271226
// unused. There only needs to be one module index entry.
12281227
if (oneof<R_TLSLD_GOT, R_TLSLD_GOTPLT, R_TLSLD_PC, R_TLSLD_HINT>(expr)) {
1229-
// Local-Dynamic relocs can be optimized to Local-Exesec->
1228+
// Local-Dynamic relocs can be optimized to Local-Exec.
12301229
if (execOptimize) {
12311230
sec->addReloc({ctx.target->adjustTlsExpr(type, R_RELAX_TLS_LD_TO_LE),
12321231
type, offset, addend, &sym});
@@ -1239,7 +1238,7 @@ unsigned RelocScan::handleTlsRelocation(RelExpr expr, RelType type,
12391238
return 1;
12401239
}
12411240

1242-
// Local-Dynamic relocs can be optimized to Local-Exesec->
1241+
// Local-Dynamic relocs can be optimized to Local-Exec.
12431242
if (expr == R_DTPREL) {
12441243
if (execOptimize)
12451244
expr = ctx.target->adjustTlsExpr(type, R_RELAX_TLS_LD_TO_LE);
@@ -1249,7 +1248,7 @@ unsigned RelocScan::handleTlsRelocation(RelExpr expr, RelType type,
12491248

12501249
// Local-Dynamic sequence where offset of tls variable relative to dynamic
12511250
// thread pointer is stored in the got. This cannot be optimized to
1252-
// Local-Exesec->
1251+
// Local-Exec.
12531252
if (expr == R_TLSLD_GOT_OFF) {
12541253
sym.setFlags(NEEDS_GOT_DTPREL);
12551254
sec->addReloc({expr, type, offset, addend, &sym});
@@ -1284,7 +1283,7 @@ unsigned RelocScan::handleTlsRelocation(RelExpr expr, RelType type,
12841283
//
12851284
// R_RISCV_TLSDESC_{LOAD_LO12,ADD_LO12_I,CALL} reference a non-preemptible
12861285
// label, so TLSDESC=>IE will be categorized as R_RELAX_TLS_GD_TO_LE. We fix
1287-
// the categorization in RISCV::relocateAllosec->
1286+
// the categorization in RISCV::relocateAlloc.
12881287
if (sym.isPreemptible) {
12891288
sym.setFlags(NEEDS_TLSIE);
12901289
sec->addReloc({ctx.target->adjustTlsExpr(type, R_RELAX_TLS_GD_TO_IE),

0 commit comments

Comments
 (0)