forked from Imagelibrary/binutils-gdb
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user