A symbol root is not needed if --gc-keep-exported is also given.
* ldlang.c (lang_end): Don't error if no --entry or --undefined
is given with -r -gc-sections if --gc-keep-exported.
+2018-10-20 Alan Modra <amodra@gmail.com>
+
+ * ldlang.c (lang_end): Don't error if no --entry or --undefined
+ is given with -r -gc-sections if --gc-keep-exported.
+
2018-10-15 Jim Wilson <jimw@sifive.com>
* emulparams/elf32lriscv-defs.sh (DATA_START_SYMBOLS): New.
warn = TRUE;
/* Force the user to specify a root when generating a relocatable with
- --gc-sections. */
- if (link_info.gc_sections && bfd_link_relocatable (&link_info)
+ --gc-sections, unless --gc-keep-exported was also given. */
+ if (bfd_link_relocatable (&link_info)
+ && link_info.gc_sections
+ && !link_info.gc_keep_exported
&& !(entry_from_cmdline || undef_from_cmdline))
einfo (_("%F%P: gc-sections requires either an entry or "
"an undefined symbol\n"));