musl: ldso/dlsym: fix mips returning undef dlsym
authorLuiz Angelo Daros de Luca <luizluca@gmail.com>
Tue, 13 Aug 2019 06:01:07 +0000 (03:01 -0300)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 17 Aug 2019 15:23:17 +0000 (17:23 +0200)
commit5e3b21c91647f72e73a550f3059fa7ea8146759f
tree6b6d000fa65fbe64b3daf9582f218c35535c8058
parent2df2b75208dce06dee02508c8d589fc5f540023d
musl: ldso/dlsym: fix mips returning undef dlsym

This happens only the second time a library is loaded by dlopen().
After lib1 is loaded, dlsym(lib1,"undef1") correctly resolves the undef
symbol from lib1 dependencies. After the second library is loaded,
dlsym(lib2,"undef1") was returning the address of "undef1" in lib2
instead of searching lib2 dependencies.

Backporting upstream fix which now uses the same logic for relocation
time and dlsym.

Fixes openwrt/packages#9297

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
package/libs/toolchain/Makefile
toolchain/musl/common.mk
toolchain/musl/patches/020-make-relocation-time-symbol-lookup-and-dlsym-consistent.patch [new file with mode: 0644]