Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(168)

Unified Diff: src/cmd/ld/lib.c

Issue 6926049: code review 6926049: 6c/6g/6l/go: PIC and shared library support. (Closed)
Patch Set: diff -r 9dacae220eca https://go.googlecode.com/hg/ Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/cmd/ld/lib.h ('k') | src/cmd/ld/symtab.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cmd/ld/lib.c
===================================================================
--- a/src/cmd/ld/lib.c
+++ b/src/cmd/ld/lib.c
@@ -104,6 +104,13 @@
sprint(INITENTRY, "_rt0_%s_%s", goarch, goos);
}
lookup(INITENTRY, 0)->type = SXREF;
+ if(flag_shared) {
+ if(LIBINITENTRY == nil) {
+ LIBINITENTRY = mal(strlen(goarch)+strlen(goos)+20);
+ sprint(LIBINITENTRY, "_rt0_%s_%s_lib", goarch, goos);
+ }
+ lookup(LIBINITENTRY, 0)->type = SXREF;
+ }
}
void
@@ -305,7 +312,7 @@
//
// 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)
+ if(!flag_shared && !havedynamic && HEADTYPE != Hdarwin)
debug['d'] = 1;
importcycles();
« no previous file with comments | « src/cmd/ld/lib.h ('k') | src/cmd/ld/symtab.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b