[all-commits] [llvm/llvm-project] 2d7a8c: [ELF] -r: don't create .interp

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Jan 16 12:14:38 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2d7a8cf90478cd845ffb39763b0e95b7715322d2
      https://github.com/llvm/llvm-project/commit/2d7a8cf90478cd845ffb39763b0e95b7715322d2
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-01-16 (Thu, 16 Jan 2020)

  Changed paths:
    M lld/ELF/Writer.cpp
    M lld/test/ELF/dynamic-linker.s

  Log Message:
  -----------
  [ELF] -r: don't create .interp

`{clang,gcc} -nostdlib -r a.c` passes --dynamic-linker to the linker,
and the expected behavior is to ignore it.

If .interp is kept in the relocatable object file, a final link will get
PT_INTERP even if --dynamic-linker is not specified. glibc ld.so expects
to see PT_DYNAMIC and the executable will likely fail to run.

Ignore --dynamic-linker in -r mode as well as -shared.




More information about the All-commits mailing list