aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
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 /bfd/elflink.c
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 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index ccb7ba2..fc1fd08 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -3488,7 +3488,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
FALSE, bed->collect, NULL)))
goto error_return;
- if (!info->relocatable && info->executable)
+ if (info->executable)
{
/* Clobber the section size so that the warning does
not get copied into the output file. */
@@ -4257,7 +4257,7 @@ error_free_dyn:
/* If the indirect symbol has been forced local, don't
make the real symbol dynamic. */
if ((h == hi || !hi->forced_local)
- && (! info->executable
+ && ((! info->executable && ! info->relocatable)
|| h->def_dynamic
|| h->ref_dynamic))
dynsym = TRUE;
@@ -8957,8 +8957,7 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data)
/* We should also warn if a forced local symbol is referenced from
shared libraries. */
- if (!flinfo->info->relocatable
- && flinfo->info->executable
+ if (flinfo->info->executable
&& h->forced_local
&& h->ref_dynamic
&& h->def_regular