diff options
| author | Ondřej Surý <ondrej@sury.org> | 2011-05-23 09:45:29 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2011-05-23 09:45:29 +0200 |
| commit | 63d29fefab5290dc96e0a03ff70603aefa995887 (patch) | |
| tree | 95da0105686f9aba568a72e7a8ebd580a4fda20e /src/cmd/ld/lib.c | |
| parent | ad811fbb8897a9a3063274e927133915941f1dca (diff) | |
| download | golang-63d29fefab5290dc96e0a03ff70603aefa995887.tar.gz | |
Imported Upstream version 2011.05.22upstream-weekly/2011.05.22
Diffstat (limited to 'src/cmd/ld/lib.c')
| -rw-r--r-- | src/cmd/ld/lib.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c index 15219ba11..105d982e4 100644 --- a/src/cmd/ld/lib.c +++ b/src/cmd/ld/lib.c @@ -259,6 +259,18 @@ loadlib(void) Bprint(&bso, "%5.2f autolib: %s (from %s)\n", cputime(), library[i].file, library[i].objref); objfile(library[i].file, library[i].pkg); } + + // We've loaded all the code now. + // If there are no dynamic libraries needed, gcc disables dynamic linking. + // Because of this, glibc's dynamic ELF loader occasionally (like in version 2.13) + // assumes that a dynamic binary always refers to at least one dynamic library. + // Rather than be a source of test cases for glibc, disable dynamic linking + // the same way that gcc would. + // + // Exception: on OS X, programs such as Shark only work with dynamic + // binaries, so leave it enabled on OS X (Mach-O) binaries. + if(!havedynamic && HEADTYPE != Hdarwin) + debug['d'] = 1; } /* |
