This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold][patch] Plugin API and PIE binaries
On Tue, Jun 12, 2012 at 10:27 AM, Cary Coutant <ccoutant@google.com> wrote:
>> This is OK if it's OK with Cary.
>
> It's OK with me. Thanks!
>
> -cary
I am checking in this as an obvious fix for ld.
--
H.J.
---
2012-06-14 H.J. Lu <hongjiu.lu@intel.com>
* plugin.c (set_tv_header): Handle link_info.pie.
diff --git a/ld/plugin.c b/ld/plugin.c
index 2515888..7e3d2a3 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -697,7 +697,9 @@ set_tv_header (struct ld_plugin_tv *tv)
case LDPT_LINKER_OUTPUT:
TVU(val) = (link_info.relocatable
? LDPO_REL
- : link_info.executable ? LDPO_EXEC : LDPO_DYN);
+ : (link_info.executable
+ ? (link_info.pie ? LDPO_PIE : LDPO_EXEC)
+ : LDPO_DYN));
break;
case LDPT_OUTPUT_NAME:
TVU(string) = output_filename;