[PATCH] D63003: [ELF] Don't emit dynamic relocations with weak undef in writable sections

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 01:13:00 PDT 2019


MaskRay added a comment.

Your previous comment is correct.

> 1. An object file contains a weak undefined symbol
> 2. No DSOs define the weak undefined symbol at link time
> 3. But some DSO defines the weak undefined symbol at run time

Currently:

- If `!CanWrite`, no dynamic relocation is created (cannot be preempted by a runtime DSO).
- If `CanWrite`, a dynamic relocation is created (can be preempted by a runtime DSO).

This patch makes it:

- If `!CanWrite`, no dynamic relocation is created
- If `CanWrite`, no dynamic relocation is created

This also appears to be what ld.bfd and gold do.


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D63003





More information about the llvm-commits mailing list