在 2022-11-18 23:40, Pali Rohár 写道:
GNU LD provides __ImageBase symbol since 2.19. This is standard windows
symbol and should be used instead of custom gnu _image_base__ symbol.

For compatibility with older GNU LD versions, define __ImageBase as weak
alias to _image_base__ symbol.

This allows to remove all #ifdef hacks for older GNU LD versions as with
this change __ImageBase works correctly with all GNU LD versions.
---

Generally speaking, one shouldn't use weak symbols when targeting Windows. I haven't investigated though, but many times weak symbols result in null or faulty addresses.

Thus, weak symbols are unacceptable; but removal of references to `__image_base__` seems fine, if dropping support for binutils 2.18 is acceptable. BTW 2.19 was released in 2008 [1].


[1] https://lists.gnu.org/archive/html/info-gnu/2008-10/msg00014.html


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to