diff options
Diffstat (limited to 'ld/ldmain.c')
-rw-r--r-- | ld/ldmain.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ld/ldmain.c b/ld/ldmain.c index 91818e0..08a0ec4 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -291,6 +291,8 @@ main (argc, argv) link_info.emitrelocations = FALSE; link_info.task_link = FALSE; link_info.shared = FALSE; + link_info.pie = FALSE; + link_info.executable = FALSE; link_info.symbolic = FALSE; link_info.export_dynamic = FALSE; link_info.static_link = FALSE; @@ -368,6 +370,9 @@ main (argc, argv) einfo (_("%P%F: -f may not be used without -shared\n")); } + if (! link_info.shared || link_info.pie) + link_info.executable = TRUE; + /* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols). I don't see how else this can be handled, since in this case we must preserve all externally visible symbols. */ |