- User Since
- Dec 28 2012, 2:34 PM (351 w, 2 d)
Aug 23 2019
Aug 22 2019
Hi @MaskRay, it looks like this change has caused some binaries to start segfaulting on Android aarch64 devices. The strange thing is that the segfault happens even before entering the dynamic loader, and furthermore the segfault doesn't happen if I invoke the dynamic loader directly, so I'm guessing that the Linux kernel doesn't like the binary for some reason.
I've attached a repro.tar that I can use to reproduce this problem reliably like so (the "CANNOT LINK EXECUTABLE" error is expected because the runtime library is not present on the device):
$ ~/l2/ra/bin/ld.lld @response.txt $ adb -s $pixel2 push bin /data/local/tmp bin: 1 file pushed. 3.9 MB/s (15608 bytes in 0.004s) $ adb -s $pixel2 shell walleye:/ # /data/local/tmp/bin Segmentation fault 139|walleye:/ # /system/bin/linker64 /data/local/tmp/bin CANNOT LINK EXECUTABLE "/data/local/tmp/bin": library "libclang_rt.hwasan-aarch64-android.so" not found
Without this change:
$ ~/l/ra/bin/ld.lld @response.txt $ adb -s $pixel2 push bin /data/local/tmp bin: 1 file pushed. 1.2 MB/s (17992 bytes in 0.014s) $ adb -s $pixel2 shell walleye:/ # /data/local/tmp/bin CANNOT LINK EXECUTABLE "/data/local/tmp/bin": library "libclang_rt.hwasan-aarch64-android.so" not found
These instructions use Android adb, but given that the problem appears to be with the Linux kernel you might be able to reproduce on regular Linux as well.
- Support aliases and other constants
Aug 21 2019
Aug 20 2019
Aug 19 2019
This would also be fixed by switching to canonical aliases, right? Maybe another data point in favour of finally switching.
Aug 16 2019
Aug 15 2019
Aug 12 2019
HWASAN should only be using GOT relative relocations to access shadow memory, so I wouldn't expect this change to have an impact on HWASAN.
Aug 9 2019
- Address review comments
Thanks for the confirmation Kees.
Aug 8 2019
- Switch to a symbol table lookup
- Use --implicit-check-not
Aug 7 2019
- Add test
MHO: The assembler is a low enough level component that the user can be presumed to know what they're doing, regardless of linker limitations. So I would prefer not to do this. If we do anything about this, we should document the limitations of the GNU linkers somewhere.