[PATCH] D64930: [ELF][AArch64] Allow PT_LOAD to have overlapping p_offset ranges

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 22 19:38:41 PDT 2019


pcc added a comment.

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.
F9844553: repro.tar <https://reviews.llvm.org/F9844553>
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.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64930





More information about the llvm-commits mailing list