direct-io.hg

changeset 11646:34452b288046

[XEN] Remove weak-extern definitions from symbols.c.
Instead we have an explicit set of dummy symbol
definitions for the inital link of the Xen image.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Sep 28 13:44:24 2006 +0100 (2006-09-28)
parents 8cffe84d8f51
children 14111cab38fd
files xen/arch/ia64/Makefile xen/arch/powerpc/Makefile xen/arch/x86/Makefile xen/common/symbols-dummy.c xen/common/symbols.c
line diff
     1.1 --- a/xen/arch/ia64/Makefile	Thu Sep 28 13:20:58 2006 +0100
     1.2 +++ b/xen/arch/ia64/Makefile	Thu Sep 28 13:44:24 2006 +0100
     1.3 @@ -4,22 +4,27 @@ subdir-y += linux
     1.4  subdir-y += linux-xen
     1.5  
     1.6  $(TARGET)-syms: linux-xen/head.o $(ALL_OBJS) xen.lds.s
     1.7 +	$(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/common/symbols-dummy.o
     1.8  	$(LD) $(LDFLAGS) -T xen.lds.s -N \
     1.9 -		-Map map.out linux-xen/head.o $(ALL_OBJS) -o $@
    1.10 +		-Map map.out linux-xen/head.o $(ALL_OBJS) \
    1.11 +		$(BASEDIR)/common/symbols-dummy.o -o $@
    1.12  	$(NM) -n $@ | $(BASEDIR)/tools/symbols > $(BASEDIR)/xen-syms.S
    1.13  	$(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/xen-syms.o
    1.14  	$(LD) $(LDFLAGS) -T xen.lds.s -N \
    1.15 -		-Map map.out linux-xen/head.o $(ALL_OBJS) $(BASEDIR)/xen-syms.o -o $@
    1.16 +		-Map map.out linux-xen/head.o $(ALL_OBJS) \
    1.17 +		$(BASEDIR)/xen-syms.o -o $@
    1.18  	$(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
    1.19  	$(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/xen-syms.o
    1.20  	$(LD) $(LDFLAGS) -T xen.lds.s -N \
    1.21 -		-Map map.out linux-xen/head.o $(ALL_OBJS) $(BASEDIR)/xen-syms.o -o $@
    1.22 +		-Map map.out linux-xen/head.o $(ALL_OBJS) \
    1.23 +		$(BASEDIR)/xen-syms.o -o $@
    1.24  	rm -f $(BASEDIR)/xen-syms.S $(BASEDIR)/xen-syms.o
    1.25  
    1.26  $(TARGET): $(TARGET)-syms
    1.27  	$(OBJCOPY) -R .note -R .comment -S $(TARGET)-syms $@
    1.28 -	$(NM) -n $(TARGET)-syms | grep -v '\( [aUw] \)\|\(__crc_\)\|\( \$[adt]\)'\
    1.29 -		 > $(BASEDIR)/System.map
    1.30 +	$(NM) -n $(TARGET)-syms | \
    1.31 +		grep -v '\( [aUw] \)\|\(__crc_\)\|\( \$[adt]\)' \
    1.32 +		> $(BASEDIR)/System.map
    1.33  
    1.34  # Headers do not depend on auto-generated header, but object files do.
    1.35  HDRS    := $(subst $(BASEDIR)/include/asm-ia64/asm-xsi-offsets.h,,$(HDRS))
     2.1 --- a/xen/arch/powerpc/Makefile	Thu Sep 28 13:20:58 2006 +0100
     2.2 +++ b/xen/arch/powerpc/Makefile	Thu Sep 28 13:44:24 2006 +0100
     2.3 @@ -101,7 +101,8 @@ TARGET_OPTS = $(OMAGIC) -Wl,-Ttext,$(xen
     2.4  TARGET_OPTS += start.o $(ALL_OBJS)
     2.5  
     2.6  .xen-syms: start.o $(ALL_OBJS) xen.lds
     2.7 -	$(CC) $(CFLAGS) $(TARGET_OPTS) -o $@
     2.8 +	$(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/common/symbols-dummy.o
     2.9 +	$(CC) $(CFLAGS) $(TARGET_OPTS) $(BASEDIR)/common/symbols-dummy.o -o $@
    2.10  
    2.11  NM=$(CROSS_COMPILE)nm
    2.12  new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
     3.1 --- a/xen/arch/x86/Makefile	Thu Sep 28 13:20:58 2006 +0100
     3.2 +++ b/xen/arch/x86/Makefile	Thu Sep 28 13:44:24 2006 +0100
     3.3 @@ -46,19 +46,24 @@ obj-$(crash_debug) += gdbstub.o
     3.4  
     3.5  $(TARGET): $(TARGET)-syms boot/mkelf32
     3.6  	./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \
     3.7 -	`$(NM) $(TARGET)-syms | sort | tail -n 1 | sed -e 's/^\([^ ]*\).*/0x\1/'`
     3.8 +	`$(NM) $(TARGET)-syms | sort | tail -n 1 | \
     3.9 +	 sed -e 's/^\([^ ]*\).*/0x\1/'`
    3.10  
    3.11  $(TARGET)-syms: boot/$(TARGET_SUBARCH).o $(ALL_OBJS) xen.lds
    3.12 +	$(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/common/symbols-dummy.o
    3.13  	$(LD) $(LDFLAGS) -T xen.lds -N \
    3.14 -	    boot/$(TARGET_SUBARCH).o $(ALL_OBJS) -o $@
    3.15 +	    boot/$(TARGET_SUBARCH).o $(ALL_OBJS) \
    3.16 +	    $(BASEDIR)/common/symbols-dummy.o -o $@
    3.17  	$(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
    3.18  	$(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/xen-syms.o
    3.19  	$(LD) $(LDFLAGS) -T xen.lds -N \
    3.20 -	    boot/$(TARGET_SUBARCH).o $(ALL_OBJS) $(BASEDIR)/xen-syms.o -o $@
    3.21 +	    boot/$(TARGET_SUBARCH).o $(ALL_OBJS) \
    3.22 +	    $(BASEDIR)/xen-syms.o -o $@
    3.23  	$(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
    3.24  	$(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/xen-syms.o
    3.25  	$(LD) $(LDFLAGS) -T xen.lds -N \
    3.26 -	    boot/$(TARGET_SUBARCH).o $(ALL_OBJS) $(BASEDIR)/xen-syms.o -o $@
    3.27 +	    boot/$(TARGET_SUBARCH).o $(ALL_OBJS) \
    3.28 +	    $(BASEDIR)/xen-syms.o -o $@
    3.29  	rm -f $(BASEDIR)/xen-syms.S $(BASEDIR)/xen-syms.o
    3.30  
    3.31  asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(HDRS)
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/xen/common/symbols-dummy.c	Thu Sep 28 13:44:24 2006 +0100
     4.3 @@ -0,0 +1,16 @@
     4.4 +/*
     4.5 + * symbols-dummy.c: dummy symbol-table definitions for the inital partial
     4.6 + *                  link of the hypervisor image.
     4.7 + */
     4.8 +
     4.9 +#include <xen/config.h>
    4.10 +#include <xen/types.h>
    4.11 +
    4.12 +unsigned long symbols_addresses[1];
    4.13 +unsigned long symbols_num_syms;
    4.14 +u8 symbols_names[1];
    4.15 +
    4.16 +u8 symbols_token_table[1];
    4.17 +u16 symbols_token_index[1];
    4.18 +
    4.19 +unsigned long symbols_markers[1];
     5.1 --- a/xen/common/symbols.c	Thu Sep 28 13:20:58 2006 +0100
     5.2 +++ b/xen/common/symbols.c	Thu Sep 28 13:44:24 2006 +0100
     5.3 @@ -16,15 +16,14 @@
     5.4  #include <xen/lib.h>
     5.5  #include <xen/string.h>
     5.6  
     5.7 -/* These will be re-linked against their real values during the second link stage */
     5.8 -extern unsigned long symbols_addresses[] __attribute__((weak));
     5.9 -extern unsigned long symbols_num_syms __attribute__((weak,section("data")));
    5.10 -extern u8 symbols_names[] __attribute__((weak));
    5.11 +extern unsigned long symbols_addresses[];
    5.12 +extern unsigned long symbols_num_syms;
    5.13 +extern u8 symbols_names[];
    5.14  
    5.15 -extern u8 symbols_token_table[] __attribute__((weak));
    5.16 -extern u16 symbols_token_index[] __attribute__((weak));
    5.17 +extern u8 symbols_token_table[];
    5.18 +extern u16 symbols_token_index[];
    5.19  
    5.20 -extern unsigned long symbols_markers[] __attribute__((weak));
    5.21 +extern unsigned long symbols_markers[];
    5.22  
    5.23  /* expand a compressed symbol data into the resulting uncompressed string,
    5.24     given the offset to where the symbol is in the compressed stream */