Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: elf/Makefile

Issue 7715030: Fix dynamic library linking. (Closed) Base URL: http://git.chromium.org/native_client/nacl-glibc.git@master
Patch Set: Comment added Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | nacl/dyn-link/ldscripts/elf64_nacl.xs » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: elf/Makefile
diff --git a/elf/Makefile b/elf/Makefile
index 07fc811c01aae3647c331a0cd8220480ba2a434a..f63f3d01178c7a5a21e035541c5af7bda1a96571 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -305,11 +305,19 @@ z-now-yes = -Wl,-z,now
$(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
@rm -f $@.lds
+ # NaCl loader refuses to run ld.so with more than 3 loadable segments.
+ # Remove the bss segment.
$(LINK.o) -nostdlib -nostartfiles -shared $(z-now-$(bind-now)) \
$(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 | \
LC_ALL=C \
- sed -e '/^=========/,/^=========/!d;/^=========/d' \
+ sed -e '/^=========/,/^=========/!d;/^=========/d' \
-e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
+ -e 's/_end = \.; PROVIDE (end = \.);/& . = DATA_SEGMENT_END(.);/' \
+ -e 's/seg_bss PT_LOAD FLAGS(6) ; \/\* read + write \*\///' \
+ -e 's/} :seg_bss/}/' \
+ -e 's/\. = DATA_SEGMENT_END (\.);//' \
+ -e 's/\. = ALIGN (CONSTANT (MAXPAGESIZE));//' \
+ -e 's/\. = ALIGN (CONSTANT (COMMONPAGESIZE));//' \
> $@.lds
$(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
$(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \
« no previous file with comments | « no previous file | nacl/dyn-link/ldscripts/elf64_nacl.xs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698