Page MenuHomeFreeBSD

rtld: add a test for RTLD_DEEPBIND
ClosedPublic

Authored by kevans on Nov 29 2023, 10:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 10, 1:20 PM
Unknown Object (File)
Nov 26 2024, 2:49 PM
Unknown Object (File)
Nov 16 2024, 11:41 AM
Unknown Object (File)
Nov 2 2024, 11:49 AM
Unknown Object (File)
Nov 2 2024, 11:49 AM
Unknown Object (File)
Nov 2 2024, 11:49 AM
Unknown Object (File)
Nov 2 2024, 11:49 AM
Unknown Object (File)
Nov 2 2024, 11:41 AM
Subscribers

Details

Summary

This tests that with RTLD_DEEPBIND, symbols are looked up in all of the
object's needed objects before the global object.

PR: 275393
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 54698
Build 51587: arc lint + arc unit

Event Timeline

libexec/rtld-elf/tests/Makefile
15

Do you new tests require lower warn level than 6?

libexec/rtld-elf/tests/libdeep/Makefile
11

Can this be some construct with $ORIGIN, to avoid abs path recording into DT_RUNPATH?

libexec/rtld-elf/tests/libdeep/libdeep.c
14

externs are not needed

libexec/rtld-elf/tests/libval/libval.c
12

extern's are not needed

kevans added inline comments.
libexec/rtld-elf/tests/libdeep/Makefile
11

lld doesn't seem to accept $ORIGIN for -rpath, unfortunately. I also couldn't figure out how to get it smuggled through bmake properly; $$ORIGIN would get through just fine as $ORIGIN, but somewhere between bmake rendering it and lld using it, it was transformed into -zrelro. I bypassed bmake and tried just linking it manually, and it gets angry because $ORIGIN's not a path.

libexec/rtld-elf/tests/Makefile
15

Nope, they're fine at the default (6)

Use -rpath $ORIGIN, thanks jrtc27
Drop redundant extern

Did you checked, does the test pass with the D42841 applied?

This revision is now accepted and ready to land.Nov 30 2023, 12:21 PM
In D42843#977270, @kib wrote:

Did you checked, does the test pass with the D42841 applied?

Yup, it's quite happy now, thanks!

libexec/rtld-elf/tests/rtld_deepbind/Makefile
3

This ends up clobbering Kyuafile from the other rtld tests. I can't push it to the directory above because it needs libval to build first, so I think I'll just push it to /usr/tests/libexec/rtld-elf/rtld_deepbind

This revision was automatically updated to reflect the committed changes.