]>
Commit | Line | Data |
---|---|---|
cefdec78 AM |
1 | commit 00d805f334c009164d7cecab931086a0545af8d1 |
2 | Author: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | |
3 | Date: Fri Oct 9 18:10:50 2009 +0200 | |
4 | ||
5 | check_ld some more flags | |
6 | ||
7 | gold does not currently implement these. | |
8 | ||
9 | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | |
10 | ||
11 | diff --git a/Rules.mak b/Rules.mak | |
12 | index d64897f..ceb1e10 100644 | |
13 | --- a/Rules.mak | |
14 | +++ b/Rules.mak | |
15 | @@ -282,7 +282,7 @@ endif | |
16 | # Idx Name Size VMA LMA File off Algn | |
17 | # 0 .text xxxxxxxx 00000000 00000000 xxxxxxxx 2**2 <===! | |
18 | CPU_CFLAGS-y += $(call check_gcc,-ffunction-sections -fdata-sections,) | |
19 | -ifneq ($(call check_ld,--sort-common,),) | |
20 | +ifneq ($(call check_ld,--sort-common),) | |
21 | CPU_LDFLAGS-y += -Wl,--sort-common | |
22 | endif | |
23 | ifneq ($(call check_ld,--sort-section alignment),) | |
24 | @@ -547,8 +547,11 @@ ifneq ($(HAVE_SHARED),y) | |
25 | CFLAGS += -DSTATIC | |
26 | endif | |
27 | ||
28 | +LDFLAG_WARN_ONCE:=$(if $(call check_ld,--warn-once),-Wl$(comma)--warn-once) | |
29 | +LDFLAG_SORT_COMMON:=$(if $(call check_ld,--sort-common),-Wl$(comma)--sort-common) | |
30 | +LDFLAG_DISCARD_ALL:=$(if $(call check_ld,--discard-all),-Wl$(comma)--discard-all) | |
31 | LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -shared \ | |
32 | - -Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc | |
33 | + -Wl,--warn-common $(LDFLAG_WARN_ONCE) -Wl,-z,combreloc | |
34 | # binutils-2.16.1 warns about ignored sections, 2.16.91.0.3 and newer are ok | |
35 | #LDFLAGS_NOSTRIP+=$(call check_ld,--gc-sections) | |
36 | ||
37 | diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in | |
38 | index 350cc81..9e228b7 100644 | |
39 | --- a/ldso/ldso/Makefile.in | |
40 | +++ b/ldso/ldso/Makefile.in | |
41 | @@ -35,7 +35,7 @@ LDFLAGS-$(UCLIBC_LDSO_NAME).so := $(LDFLAGS) | |
42 | else | |
43 | LDFLAGS-$(UCLIBC_LDSO_NAME).so := $(LDFLAGS_NOSTRIP) -Wl,-z,defs | |
44 | endif | |
45 | -LDFLAGS-$(UCLIBC_LDSO_NAME).so += -Wl,-e,_start -Wl,-z,now -Wl,-Bsymbolic -Wl,--export-dynamic -Wl,--sort-common -Wl,--discard-locals -Wl,--discard-all -Wl,--no-undefined | |
46 | +LDFLAGS-$(UCLIBC_LDSO_NAME).so += -Wl,-e,_start -Wl,-z,now -Wl,-Bsymbolic -Wl,--export-dynamic $(LDFLAG_SORT_COMMON) -Wl,--discard-locals $(LDFLAG_DISCARD_ALL) -Wl,--no-undefined | |
47 | ||
48 | ldso_FULL_NAME := $(UCLIBC_LDSO_NAME)-$(VERSION).so | |
49 |