Page MenuHomeFreeBSD

libsys: link symbolic
ClosedPublic

Authored by kib on Feb 22 2024, 9:14 PM.
Tags
None
Referenced Files
F151221180: D44027.diff
Mon, Apr 6, 10:56 PM
F151123165: D44027.id134857.diff
Mon, Apr 6, 6:01 AM
Unknown Object (File)
Sun, Apr 5, 9:22 AM
Unknown Object (File)
Sat, Apr 4, 3:45 PM
Unknown Object (File)
Fri, Mar 27, 5:56 PM
Unknown Object (File)
Mar 2 2026, 12:34 AM
Unknown Object (File)
Mar 2 2026, 12:21 AM
Unknown Object (File)
Feb 8 2026, 5:30 PM

Details

Summary

so that libc/libthr do not preempt libsys symbols, esp. errno-related

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Feb 22 2024, 9:14 PM

To confirm I understand this:

  • Linking libsys.so without -Bsymbolic means the linker deems the various symbols preemptible
  • If libc.so is earlier in the link map then libsys's unfiltered symbols will be preempted by libc.so's at run time

I can conform this fixes the issues I've seen with an WITH_BIND_NOW jail.

This revision is now accepted and ready to land.Feb 22 2024, 11:53 PM

To confirm I understand this:

  • Linking libsys.so without -Bsymbolic means the linker deems the various symbols preemptible
  • If libc.so is earlier in the link map then libsys's unfiltered symbols will be preempted by libc.so's at run time

It also means that symbols looked up not _from the filter_ are preempted. This is the cause of the problem

This revision was automatically updated to reflect the committed changes.

This change breaks legacy programs that declare extern int errno; instead of including errno.h. Maybe we want to find a different solution.

In D44027#1066388, @fuz wrote:

This change breaks legacy programs that declare extern int errno; instead of including errno.h. Maybe we want to find a different solution.

See D46780 for a change that completes the removal of the errno symbol.