aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-07-29 09:11:15 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-07-29 09:14:05 -0700
commite77e648e93adf564fb10e725e4d8800d30a83eb5 (patch)
tree8c6397934779a223689d59b7a7cc21cf9d080ec6 /ld
parent1eef6428112a1c1fe0295f36f92d7a3cf9908228 (diff)
downloadfsf-binutils-gdb-e77e648e93adf564fb10e725e4d8800d30a83eb5.zip
fsf-binutils-gdb-e77e648e93adf564fb10e725e4d8800d30a83eb5.tar.gz
fsf-binutils-gdb-e77e648e93adf564fb10e725e4d8800d30a83eb5.tar.bz2
Don't set link_info.executable for "ld -r"
This patch changes "ld -r" not to set link_info.executable. It removes !info->relocatable check for info->executable and adds it for !info->executable in elflink.c. bfd/ * elflink.c (elf_link_add_object_symbols): Remove !info->relocatable check for info->executable. Add !info->relocatable check for !info->executable. (elf_link_output_extsym): Remove !info->relocatable check for info->executable. ld/ * lexsup.c (parse_args): Don't set link_info.executable to TRUE for link_info.relocatable.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/lexsup.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 3f53f13..d1b819b 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-29 H.J. Lu <hongjiu.lu@intel.com>
+
+ * lexsup.c (parse_args): Don't set link_info.executable to
+ TRUE for link_info.relocatable.
+
2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.
diff --git a/ld/lexsup.c b/ld/lexsup.c
index b884d9a..0aa67f5 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -1578,7 +1578,7 @@ parse_args (unsigned argc, char **argv)
einfo (_("%P%F: -f may not be used without -shared\n"));
}
- if (! link_info.shared || link_info.pie)
+ if ((! link_info.shared && ! link_info.relocatable) || link_info.pie)
link_info.executable = TRUE;
/* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols). I