On Thu, 7 Oct 2021, Martin Storsjö wrote: > This can also happen if calling a function which is marked "DATA" in > the def files as it's not meant to be called/used normally (because we > provide a replacement in libmingwex or lib*crt* that we think should > be used instead). If the function that is meant to be called is missing > (this can happen in misconfigured builds where the libraries are lacking > symbols that we expect to provide, see [2]), the linker can end up doing > an autoimport of the function into a 32 bit RIP-relative offset. > (This only happens with Clang; GCC creates a .refptr stub for the > function in these cases, while Clang expects such stubs not to be needed > for functions, only for data.)
I thought pseudo-relocs were only needed when auto-importing an offset from an exported symbol (ie, a struct member or something like that), and that otherwse something in the normal Windows loader was leveraged. If this is indeed where the truncated 32-bit relative runtime relocations happen, it sounds very nice to have an immediate error instead of waiting until the function happens to be called. Also, I have seen issues that look like this in GCC, not just Clang. I don't recall any manual overriding of the code model either. _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
