You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[LLD] [COFF] Warn if the runtime pseudo relocation function is missing
When then linker creates runtime pseudo relocations, it places them
in a list with the assumption that the runtime will fix these
relocations later, when the image gets loaded. If the relevant
runtime function doesn't seem to be present in the linked image,
print a warning.
Normally when linking the mingw-w64 runtime libraries, this function
always is available. However, if linking without including the
mingw-w64 CRT startup files, and the image needs runtime pseudo
relocations, try to make the user aware of the situation.
This just prints a warning to alert the user about this situation.
Alternatively, we could also make this situation a hard error.
With ld.bfd, this situation is a hard error; ld.bfd adds an
undefined reference to this symbol if runtime pseudo relocations
are needed.
Yet another alternative would be to actually try to pull in the
symbol (if seen in a static library, but not included yet). This
would allow decoupling the function from the main CRT startup code
(making it optional, only running if the linker actually produced
runtime pseudo relocations). Doing that would require restructuring
the code (gathering pseudo relocations earlier, in order to be able
to continue linking in more object files if the initial set did
require pseudo relocations) though.
Also, ld.bfd doesn't currently successfully pull in more object
files to satisfy the dependency on _pei386_runtime_relocator,
so with that in mind, there's not much extra value in making LLD
do it currently either.
This fixes one issue brought up in
#84424.
0 commit comments