Re: [PATCH v2 1/1] Check linker for --image-base support

Christian Hesse via Grub-devel <[email protected]> Mon, 1 Dec 2025 16:02:47 +0100
Newsgroups org.gnu.grub-devel
Message-ID <[email protected]>
Nicholas Vinson <[email protected]> on Tue, 2025/11/18 19:38:
> In several scenarios, configure tests assume it's safe to use
> '-Wl,-Ttext,<address>', but starting with ld.lld-21, blindly using that
> flag may result in configure-test failures due to ld.lld failing to
> link. The failure is because ld.lld-21 no longer allows the specified
> address is less than the base address.
> 
> However, ld.lld-21+ and ld.bfd-2.44+ both provide support for the
> --image-base flag making it preferable over the older `-Ttext` flag.

This breaks the start address in i386-pc/kernel.img, which should be 0x9000,
but became 0x9074.

The error message is:

/usr/bin/grub-install: error: `/usr/lib/grub/i386-pc/kernel.img' is
miscompiled: its start address is 0x9074 instead of 0x9000: ld.gold bug?.
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEXHmveYAHrRp+prOviUUh18yA9HYFAmktrhcACgkQiUUh18yA
9HZBfQf+KgLG2YW8mVMLlPAIhcpC5Q9F/vNMoxhtR9XZ2giTV/OjBl0Lf++iZA8w
JynW9qh77YfzHW5RgQ7c9P/Q9fpDZ2qcUROckuwpEy2zEgLRVjPC3640eX4K3Pr7
VxydB4D9AUWxv+hftpeK4ARdILh6m5Oxy5RAHeubrMl8S/H2C+CaeGAeGLg2q8Cj
UKDpJ8/4UbqUxLeYeW8R1gWAIK1Sf3mQYIvAYkb4scq1fEf8uHEaR8ntV/ZwQSwB
1EHdZKgnMMuiZyvXxJxQ4bdwlAnBWfXrPTA+GwKKEb1YK9AoG4E4h6ZMsekFW3ty
7/QkXDx3KZ2xu9cIde3nhd9B1VKbew==
=ExQ0
-----END PGP SIGNATURE-----