From 833d6cc8ececc11e7fd615972e407d0fca425545 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 16 Jul 2007 13:10:49 +0100 Subject: [PATCH] Add __bss16() macro, and allow use of .bss16 section by removing link-time check for section overlaps. (In order to avoid wasting space in the executable image, .bss16 will overlap with the following section, which is .text). --- src/arch/i386/Config | 2 +- src/arch/i386/include/librm.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/arch/i386/Config b/src/arch/i386/Config index 436917f8..b4335b39 100644 --- a/src/arch/i386/Config +++ b/src/arch/i386/Config @@ -130,7 +130,7 @@ endif # this is almost always a win. the kernel uses it, too. CFLAGS+= -mpreferred-stack-boundary=2 -LDFLAGS+= -N +LDFLAGS+= -N --no-check-sections ifeq "$(shell uname -s)" "FreeBSD" CFLAGS+= -DIMAGE_FREEBSD -DELF_IMAGE -DAOUT_IMAGE diff --git a/src/arch/i386/include/librm.h b/src/arch/i386/include/librm.h index 9e9498cb..e583055e 100644 --- a/src/arch/i386/include/librm.h +++ b/src/arch/i386/include/librm.h @@ -27,6 +27,14 @@ extern char *text16; __attribute__ (( section ( ".data16" ) )) \ _data16_ ## variable array __asm__ ( #variable ) +#define __bss16( variable ) \ + __attribute__ (( section ( ".bss16" ) )) \ + _data16_ ## variable __asm__ ( #variable ) + +#define __bss16_array( variable, array ) \ + __attribute__ (( section ( ".bss16" ) )) \ + _data16_ ## variable array __asm__ ( #variable ) + #define __text16( variable ) \ __attribute__ (( section ( ".text16.data" ) )) \ _text16_ ## variable __asm__ ( #variable )