Commit e50e4f7e authored by Shenghou Ma's avatar Shenghou Ma

cmd/ld: supply -s to gcc if -s is passed.

Fixes #5463.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9239045
parent ccd1d07c
......@@ -909,6 +909,7 @@ doelf(void)
addstring(shstrtab, ".gopclntab");
if(linkmode == LinkExternal) {
debug_s = debug['s'];
debug['s'] = 0;
debug['d'] = 1;
......
......@@ -666,8 +666,11 @@ hostlink(void)
argv[argc++] = "-m64";
break;
}
if(!debug['s'])
if(!debug['s'] && !debug_s) {
argv[argc++] = "-gdwarf-2";
} else {
argv[argc++] = "-s";
}
if(HEADTYPE == Hdarwin)
argv[argc++] = "-Wl,-no_pie,-pagezero_size,4000000";
argv[argc++] = "-o";
......
......@@ -159,6 +159,7 @@ EXTERN char* interpreter;
EXTERN char* tmpdir;
EXTERN char* extld;
EXTERN char* extldflags;
EXTERN int debug_s; // backup old value of debug['s']
enum
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment