From 23656d08e2055c62b09138f9330c15f088d74127 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Thu, 17 Jan 2008 19:11:18 +0000 Subject: A patch from our Blackfin repository, originally from Jie Zhang. This fixes a problem where the linker was trying to use the wrong symbol name for the init function. Define SYMBOL_PREFIX as _ in Rules.mak for h8300, bfin, i960, microblaze, and v850. Add -D__UCLIBC_UNDERSCORES__ in CFLAGS for targets which define SYMBOL_PREFIX as _. Remove defines and undefs from uClibc_arch_features.h of each target. Add $(SYMBOL_PREFIX) to __uClibc_init when passed by ld option -init. --- Rules.mak | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Rules.mak') diff --git a/Rules.mak b/Rules.mak index bda4e1853..11c94fb15 100644 --- a/Rules.mak +++ b/Rules.mak @@ -276,6 +276,7 @@ ifeq ($(TARGET_ARCH),sh64) endif ifeq ($(TARGET_ARCH),h8300) + SYMBOL_PREFIX=_ CPU_LDFLAGS-$(CONFIG_H8300H)+= -Wl,-ms8300h CPU_LDFLAGS-$(CONFIG_H8S) += -Wl,-ms8300s CPU_CFLAGS-$(CONFIG_H8300H) += -mh -mint32 @@ -310,6 +311,7 @@ ifeq ($(TARGET_ARCH),powerpc) endif ifeq ($(TARGET_ARCH),bfin) + SYMBOL_PREFIX=_ ifeq ($(UCLIBC_FORMAT_FDPIC_ELF),y) CPU_CFLAGS-y:=-mfdpic CPU_LDFLAGS-y += -Wl,-melf32bfinfd @@ -338,6 +340,18 @@ ifeq ($(strip $(TARGET_ARCH)),avr32) CPU_LDFLAGS-$(CONFIG_LINKRELAX) += --relax endif +ifeq ($(TARGET_ARCH),i960) + SYMBOL_PREFIX=_ +endif + +ifeq ($(TARGET_ARCH),microblaze) + SYMBOL_PREFIX=_ +endif + +ifeq ($(TARGET_ARCH),v850) + SYMBOL_PREFIX=_ +endif + # Keep the check_gcc from being needlessly executed ifndef PIEFLAG ifneq ($(UCLIBC_BUILD_PIE),y) @@ -533,6 +547,10 @@ ifneq ($(DOASSERTS),y) CFLAGS+=-DNDEBUG endif +ifeq ($(SYMBOL_PREFIX),_) +CFLAGS+=-D__UCLIBC_UNDERSCORES__ +endif + # Keep the check_as from being needlessly executed ifndef ASFLAGS_NOEXEC ifeq ($(UCLIBC_BUILD_NOEXECSTACK),y) -- cgit v1.2.3