No valid FreeBSD binary ever called them (they would call lchown and
msync directly) and we haven't supported NetBSD binaries in ages.
Details
- Reviewers
imp kib - Commits
- rS335983: Get rid of netbsd_lchown and netbsd_msync syscall entries.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/compat/freebsd32/syscalls.master | ||
---|---|---|
503 ↗ | (On Diff #43790) | Does audit entry value useful for OBSOL syscalls ? Should it be changed to AUE_NULL ? |
I just discover that libc exported these syscalls. Technically this change is an impermissible ABI break, but there isn't any valid way to the the published API to link to those symbols so I think that's ok. If it's not, I can add trivial stubs for netbsd_lchown() and netbsd_msync() that just call the respective __sys_*.
I believe that stubs which return ENOSYS are fine, without redirecting to the syscalls. More, the stubs do not need to provide the default version, so that linking with the symbols will be impossible any more.
But my opinion is that we must not break the ABI this way, on principle. At least because it makes it needed to argue why other breakage is not allowed. When the rule is 'no breakage at all' it does not require arguments.
You can create symbols which are exported but not linkable, since they do not provide a default version. Such symbol can be only created by asm '@' syntax, it should be removed from the version map. Also I do not see a sense in leaving the private symbols around.
As far as I can tell I'm doing exactly what this diff does. The only difference is that I should probably spell compat_enosys as __compat_enosys
Can you show me the output of readelf -a libc.so.7 | grep netbsd_lchown for your libc ?
$readelf -a ~/obj/home/bed22/git/freebsd/amd64.amd64/lib/libc/libc.so.7 | grep netbsd_lchown 168: 000000000008c0e0 17 FUNC LOCAL DEFAULT 12 __sys_netbsd_lchown 169: 000000000008c0e0 17 FUNC LOCAL DEFAULT 12 _netbsd_lchown 170: 000000000008c0e0 17 FUNC LOCAL DEFAULT 12 netbsd_lchown
I don't understand why there isn't an exported symbol. I've got a:
__sym_compat(netbsd_lchown, compat_enosys, FBSD_1.1);
Just like the gets review.
lib/libc/sys/compat-stub.c | ||
---|---|---|
43 ↗ | (On Diff #44182) | compat_enosyS This is why the symbol is not present in the export table. |
readelf -a libc.so.7.full | grep netbsd 905: 000000000008cf10 11 FUNC GLOBAL DEFAULT 12 netbsd_msync@FBSD_1.0 (2) 3141: 000000000008cf10 11 FUNC GLOBAL DEFAULT 12 netbsd_lchown@FBSD_1.0 (2) 165: 000000000008c0a0 17 FUNC LOCAL DEFAULT 12 __sys_netbsd_msync 166: 000000000008c0a0 17 FUNC LOCAL DEFAULT 12 _netbsd_msync 167: 000000000008c0a0 17 FUNC LOCAL DEFAULT 12 netbsd_msync 168: 000000000008c0e0 17 FUNC LOCAL DEFAULT 12 __sys_netbsd_lchown 169: 000000000008c0e0 17 FUNC LOCAL DEFAULT 12 _netbsd_lchown 170: 000000000008c0e0 17 FUNC LOCAL DEFAULT 12 netbsd_lchown 2040: 000000000008cf10 11 FUNC GLOBAL DEFAULT 12 netbsd_lchown 2041: 000000000008cf10 11 FUNC GLOBAL DEFAULT 12 netbsd_msync