Skip to content

Commit 6d98f11

Browse files
committed
[ELF] Work around extra "warning: $" with MSVC 14.41.34120
1 parent 0060c54 commit 6d98f11

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lld/ELF/InputSection.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,9 +1117,13 @@ void InputSection::relocateNonAlloc(Ctx &ctx, uint8_t *buf,
11171117
// 2017 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82630), but we need to
11181118
// keep this bug-compatible code for a while.
11191119
bool isErr = expr != R_PC && !(emachine == EM_386 && type == R_386_GOTPC);
1120-
auto diag = isErr ? Err(ctx) : Warn(ctx);
1121-
diag << getLocation(offset) << ": has non-ABS relocation " << type
1122-
<< " against symbol '" << &sym << "'";
1120+
{
1121+
ELFSyncStream diag(ctx, isErr && !ctx.arg.noinhibitExec
1122+
? DiagLevel::Err
1123+
: DiagLevel::Warn);
1124+
diag << getLocation(offset) << ": has non-ABS relocation " << type
1125+
<< " against symbol '" << &sym << "'";
1126+
}
11231127
if (!isErr)
11241128
target.relocateNoSym(
11251129
bufLoc, type,

0 commit comments

Comments
 (0)