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)
Sat, Aug 17, 4:49 AM
Unknown Object (File)
Mon, Aug 5, 10:39 PM
Unknown Object (File)
Dec 20 2023, 5:49 AM
Unknown Object (File)
Aug 27 2023, 1:50 PM
Unknown Object (File)
Aug 5 2023, 4:37 PM
Unknown Object (File)
Aug 5 2023, 4:37 PM
Unknown Object (File)
Aug 5 2023, 4:11 PM
Unknown Object (File)
May 15 2023, 9:03 AM
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.