[git commit] ldso: silence warning

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Fri Feb 27 09:41:30 UTC 2015


commit: http://git.uclibc.org/uClibc/commit/?id=cb5af0bed860aac12b87b2044f6f519deded40f9
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

In file included from ldso/ldso/ldso.c:87:0:
ldso/ldso/dl-startup.c: In function '_dl_start':
ldso/ldso/dl-startup.c:184:32: warning: cast from pointer to integer of differennt size [-Wpointer-to-int-cast]
   auxvt[AT_BASE].a_un.a_val =  (Elf32_Addr) &_begin;

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 Makerules              |    2 +-
 ldso/ldso/dl-startup.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makerules b/Makerules
index 87e3c19..1596988 100644
--- a/Makerules
+++ b/Makerules
@@ -330,7 +330,7 @@ define create-lds
 	-Wl,-z,relro -Wl,--hash-style=gnu -Wl,-z,defs \
 	-Wl,--verbose 2>&1 | LC_ALL=C \
 	$(SED) -e '/^=========/,/^=========/!d;/^=========/d' \
-	-e 's/\. = .* + SIZEOF_HEADERS;/& $(SYMBOL_PREFIX)_begin = . - SIZEOF_HEADERS;/' > $@.lds
+	-e 's/^\([ 	]*\)\. = .* + SIZEOF_HEADERS;/&\n\1$(SYMBOL_PREFIX)_begin = . - SIZEOF_HEADERS;/' > $@.lds
 endef
 
 define link.so
diff --git a/ldso/ldso/dl-startup.c b/ldso/ldso/dl-startup.c
index 4893409..18a39ce 100644
--- a/ldso/ldso/dl-startup.c
+++ b/ldso/ldso/dl-startup.c
@@ -95,8 +95,8 @@
 #include "dl-startup.h"
 
 #ifdef __LDSO_PRELINK_SUPPORT__
-/* These defined magically in the linker script.  */
-extern char _begin[] attribute_hidden;
+/* This is defined by the linker script.  */
+extern ElfW(Addr) _begin[] attribute_hidden;
 #endif
 
 /* Static declarations */
@@ -181,7 +181,7 @@ DL_START(unsigned long args)
 	 */
 
 	if (!auxvt[AT_BASE].a_un.a_val)
-		auxvt[AT_BASE].a_un.a_val =  (Elf32_Addr) &_begin;
+		auxvt[AT_BASE].a_un.a_val =  (ElfW(Addr)) &_begin;
 	/* Note: if the dynamic linker itself is prelinked, the load_addr is 0 */
 	DL_INIT_LOADADDR_BOOT(load_addr, elf_machine_load_address());
 #else


More information about the uClibc-cvs mailing list