Skip to content

Commit

Permalink
[ELF] Speculatively fix older MSVC after &ctx change
Browse files Browse the repository at this point in the history
https://lab.llvm.org/buildbot/#/builders/107/builds/3155
```
error C2039: 'ctx': is not a member of '`anonymous-namespace'::Writer<ELFT>::fixSectionAlignments::<lambda_38c4af40b02773e966aeff2e6bd45bf2>'
```
  • Loading branch information
MaskRay committed Sep 21, 2024
1 parent dc2deb5 commit c64277d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lld/ELF/Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2387,7 +2387,7 @@ void Writer<ELFT>::addPhdrForSection(Partition &part, unsigned shType,
// such section.
template <class ELFT> void Writer<ELFT>::fixSectionAlignments() {
const PhdrEntry *prev;
auto pageAlign = [&](const PhdrEntry *p) {
auto pageAlign = [&, &ctx = this->ctx](const PhdrEntry *p) {
OutputSection *cmd = p->firstSec;
if (!cmd)
return;
Expand Down Expand Up @@ -2427,13 +2427,13 @@ template <class ELFT> void Writer<ELFT>::fixSectionAlignments() {
// bug, musl (TLS Variant 1 architectures) before 1.1.23 handled TLS
// blocks correctly. We need to keep the workaround for a while.
else if (ctx.tlsPhdr && ctx.tlsPhdr->firstSec == p->firstSec)
cmd->addrExpr = [&ctx = this->ctx] {
cmd->addrExpr = [&ctx] {
return alignToPowerOf2(ctx.script->getDot(), ctx.arg.maxPageSize) +
alignToPowerOf2(ctx.script->getDot() % ctx.arg.maxPageSize,
ctx.tlsPhdr->p_align);
};
else
cmd->addrExpr = [&ctx = this->ctx] {
cmd->addrExpr = [&ctx] {
return alignToPowerOf2(ctx.script->getDot(), ctx.arg.maxPageSize) +
ctx.script->getDot() % ctx.arg.maxPageSize;
};
Expand Down

0 comments on commit c64277d

Please sign in to comment.