rprichard added a comment.

> further confirmation if android_get_device_api_level should work from 
> ifunc_resolver

IIRC an ifunc resolver in Bionic can't generally call any functions in libc, 
including `android_get_device_api_level` or `__system_property_get`, because 
the ifunc resolver will typically be called before relocations in libc.so have 
been resolved. I believe an ifunc resolver also can't call 
`__system_property_get` because the libc.so system properties are initialized 
by a constructor function, which isn't called until after relocations are 
applied (`__libc_preinit` -> `__libc_preinit_impl` -> `__libc_init_common` -> 
`__system_properties_init`).

I suspect Bionic ought to apply relocations to libraries in a bottom-up 
fashion, so that libc.so is relocated before the executable or shared objects, 
but I _think_ it's currently top-down. Deferring ifunc relocations until after 
non-ifunc relocations are applied is a separate problem.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158641/new/

https://reviews.llvm.org/D158641

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to