--- src/ld/OutputFile.cpp +++ src/ld/OutputFile.cpp @@ -873,8 +873,8 @@ void OutputFile::rangeCheckAbsolute32(int64_t displacement, ld::Internal& state, // .long _foo + 0x40000000 // so if _foo lays out to 0xC0000100, the first is ok, but the second is not. if ( (_options.architecture() == CPU_TYPE_ARM) || (_options.architecture() == CPU_TYPE_I386) ) { - // Unlikely userland code does funky stuff like this, so warn for them, but not warn for -preload - if ( _options.outputKind() != Options::kPreload ) { + // Unlikely userland code does funky stuff like this, so warn for them, but not warn for -preload or -static + if ( (_options.outputKind() != Options::kPreload) && (_options.outputKind() != Options::kStaticExecutable) ) { warning("32-bit absolute address out of range (0x%08llX max is 4GB): from %s + 0x%08X (0x%08llX) to 0x%08llX", displacement, atom->name(), fixup->offsetInAtom, atom->finalAddress(), displacement); }