diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-29 16:25:25 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-29 16:25:25 +0000 | 
| commit | ab44ce3d598882e51a25eb82eb7ae6308de85ae6 (patch) | |
| tree | 568d786a59d49bef961dcb9bd09d422701b9da5b /tools/gold/gold-plugin.cpp | |
| parent | b5630dbadf9a2a06754194387d6b0fd9962a67f1 (diff) | |
Diffstat (limited to 'tools/gold/gold-plugin.cpp')
| -rw-r--r-- | tools/gold/gold-plugin.cpp | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp index 9b783d19a283..cf207d9dbbb3 100644 --- a/tools/gold/gold-plugin.cpp +++ b/tools/gold/gold-plugin.cpp @@ -102,7 +102,7 @@ static ld_plugin_add_input_file add_input_file = nullptr;  static ld_plugin_set_extra_library_path set_extra_library_path = nullptr;  static ld_plugin_get_view get_view = nullptr;  static bool IsExecutable = false; -static Optional<Reloc::Model> RelocationModel; +static Optional<Reloc::Model> RelocationModel = None;  static std::string output_name = "";  static std::list<claimed_file> Modules;  static DenseMap<int, void *> FDToLeaderHandle; @@ -282,6 +282,8 @@ ld_plugin_status onload(ld_plugin_tv *tv) {      case LDPT_LINKER_OUTPUT:        switch (tv->tv_u.tv_val) {        case LDPO_REL: // .o +        IsExecutable = false; +        break;        case LDPO_DYN: // .so          IsExecutable = false;          RelocationModel = Reloc::PIC_; @@ -726,7 +728,7 @@ static std::unique_ptr<LTO> createLTO() {    Conf.Options.RelaxELFRelocations = false;    Conf.MAttrs = MAttrs; -  Conf.RelocModel = *RelocationModel; +  Conf.RelocModel = RelocationModel;    Conf.CGOptLevel = getCGOptLevel();    Conf.DisableVerify = options::DisableVerify;    Conf.OptLevel = options::OptLevel; | 
