[PATCH] D62765: [ELF] Simplify the condition to create .interp

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 2 22:17:22 PDT 2019

MaskRay added a comment.

> I'm a little curious about the motivation of this change. Did this incompatibility cause a practical issue, or are you just fixing a disparity?

I noticed this before but didn't think hard about it.

I rediscovered it while playing with `-static-pie`. ld.bfd has a `--no-dynamic-linker` (added in 2015) to suppress its default `--dynamic-linker`. It would not have been useful if ld.bfd didn't have the default `--dynamic-linker` in the first place... I guess our `!SharedFiles.empty()` was probably a mistake of copying gold's behavior (it should check `!Config->Shared` instead)

        if ((!parameters->options().shared()
  	   || parameters->options().dynamic_linker() != NULL)
  	  && this->interp_segment_ == NULL)

Our current rule precludes a dynamically linked executable with no `DT_NEEDED`. Such executables may be created by `-nostdlib`. I would not bother supporting this use case if the change required more code.

  rLLD LLVM Linker



More information about the llvm-commits mailing list