HomePhabricator

[Driver] -static-pie: add -z text

Description

[Driver] -static-pie: add -z text

This matches gcc -static-pie. The intention is to prevent dynamic
relocations in read-only segments.

In ld.bfd and gold, -z notext is the default. If text relocations are needed:

  • -z notext: allow and emit DF_TEXTREL. DF_TEXTREL is not emitted if there is no text relocation.
  • -z text: error

In lld, -z text is the default (this change is a no-op).

  • -z text: error on text relocations
  • -z notext: allow text relocations, and emit DF_TEXTREL no matter whether text relocations exist.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D62606

Details

Committed
MaskRayMay 29 2019, 6:55 PM
Reviewer
sivachandra
Differential Revision
D62606: [Driver] -static-pie: add -z text
Branches
Unknown
Tags
Unknown