This is a small example of using DT_FILTER flag on a DSO. Unfortunately it does not work as I would expect (https://stackoverflow.com/questions/67879573/hiding-symbols-from-a-dso-with-dt-filter).
glibc ticket: https://sourceware.org/bugzilla/show_bug.cgi?id=27977