Use LTO_CODEGEN_PIC_MODEL_DYNAMIC for PIE. This requirest a git version of
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 13 Jun 2012 13:30:24 +0000 (13:30 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 13 Jun 2012 13:30:24 +0000 (13:30 +0000)
gold to work. Since the enum value LDPO_PIE has just been added to plugin-api.h,
use a numeric constant for now so that we don't require an unreleased
version of gold to build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158402 91177308-0d34-0410-b5e6-96231b3b80d8

tools/gold/gold-plugin.cpp

index cfd84c0f67d792433ba40368adefc733923a8069..9c17da6a4cb6e4a83e0f0c3cc633523b9c114aa5 100644 (file)
@@ -153,6 +153,8 @@ ld_plugin_status onload(ld_plugin_tv *tv) {
         switch (tv->tv_u.tv_val) {
           case LDPO_REL:  // .o
           case LDPO_DYN:  // .so
+          // FIXME: Replace 3 with LDPO_PIE once that is in a released binutils.
+          case 3: // position independent executable
             output_type = LTO_CODEGEN_PIC_MODEL_DYNAMIC;
             break;
           case LDPO_EXEC:  // .exe