Skip to content

Conversation

@rhelmot
Copy link
Contributor

@rhelmot rhelmot commented Nov 17, 2024

This test assumes that libdl.so's dlopen actually works, but it does not on FreeBSD. You need to link against libc for the working function, but that provides the same error stub as libdl (see below). In order to get it to actually work correctly, the dynamic loader will resolve the weak symbol to a function defined within ld-elf.so itself, and so the test is not trivially fixable.

I can provide more FreeBSD system references if needed.

$ objdump -d /lib/libc.so.7 | grep -A8 '<dlopen>'
0000000000094d10 <dlopen>:
   94d10: 55                            pushq   %rbp
   94d11: 48 89 e5                      movq    %rsp, %rbp
   94d14: 48 8d 3d 05 45 fb ff          leaq    -0x4bafb(%rip), %rdi    # 0x49220
   94d1b: 31 c0                         xorl    %eax, %eax
   94d1d: e8 5e 4d 13 00                callq   0x1c9a80 <_rtld_error@plt>
   94d22: 31 c0                         xorl    %eax, %eax
   94d24: 5d                            popq    %rbp
   94d25: c3                            retq

@arigo arigo merged commit f44941e into python-cffi:main Nov 18, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants