Page MenuHomeFreeBSD

Build the kernel with -z notext.
ClosedPublic

Authored by markj on May 14 2019, 3:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 4:15 AM
Unknown Object (File)
Tue, Nov 5, 12:58 PM
Unknown Object (File)
Thu, Oct 31, 2:32 PM
Unknown Object (File)
Mon, Oct 28, 9:31 AM
Unknown Object (File)
Oct 20 2024, 7:47 AM
Unknown Object (File)
Oct 2 2024, 5:37 AM
Unknown Object (File)
Sep 30 2024, 12:30 AM
Unknown Object (File)
Sep 26 2024, 9:51 PM
Subscribers

Details

Summary

The upstream implementation of -z ifunc-noplt disallows the combination
of -z text and -z ifunc-noplt. With this change DT_TEXTREL will be set
in the kernel executable, but AFAIK the change is effectively a no-op.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added reviewers: emaste, kib.
This revision is now accepted and ready to land.May 14 2019, 3:55 PM

BTW would it be better to use the -Wl,-z,notext -Wl,-z,ifunc-noplt syntax ?

In D20260#436661, @kib wrote:

BTW would it be better to use the -Wl,-z,notext -Wl,-z,ifunc-noplt syntax ?

Yes, or even -Wl,-z,notext,-z,ifunc-noplt. But at least the -z and its arg should be in the same -Wl, IMO.

In D20260#436661, @kib wrote:

BTW would it be better to use the -Wl,-z,notext -Wl,-z,ifunc-noplt syntax ?

Yes, or even -Wl,-z,notext,-z,ifunc-noplt. But at least the -z and its arg should be in the same -Wl, IMO.

Heh, I did not notice before that we are modifying LDFLAGS, not CFLAGS. So -Wl is entirely redundant and kib's suggested syntax does not work. I will remove -Wl first in a separate commit.

This revision was automatically updated to reflect the committed changes.