Browse Source

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).
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
833d6cc8ec
2 changed files with 9 additions and 1 deletions
  1. 1
    1
      src/arch/i386/Config
  2. 8
    0
      src/arch/i386/include/librm.h

+ 1
- 1
src/arch/i386/Config View File

130
 # this is almost always a win. the kernel uses it, too.
130
 # this is almost always a win. the kernel uses it, too.
131
 CFLAGS+= -mpreferred-stack-boundary=2
131
 CFLAGS+= -mpreferred-stack-boundary=2
132
 
132
 
133
-LDFLAGS+=	-N
133
+LDFLAGS+=	-N --no-check-sections
134
 
134
 
135
 ifeq "$(shell uname -s)" "FreeBSD"
135
 ifeq "$(shell uname -s)" "FreeBSD"
136
 CFLAGS+=	-DIMAGE_FREEBSD -DELF_IMAGE -DAOUT_IMAGE
136
 CFLAGS+=	-DIMAGE_FREEBSD -DELF_IMAGE -DAOUT_IMAGE

+ 8
- 0
src/arch/i386/include/librm.h View File

27
 	__attribute__ (( section ( ".data16" ) ))			\
27
 	__attribute__ (( section ( ".data16" ) ))			\
28
 	_data16_ ## variable array __asm__ ( #variable )
28
 	_data16_ ## variable array __asm__ ( #variable )
29
 
29
 
30
+#define __bss16( variable )						\
31
+	__attribute__ (( section ( ".bss16" ) ))			\
32
+	_data16_ ## variable __asm__ ( #variable )
33
+
34
+#define __bss16_array( variable, array )				\
35
+	__attribute__ (( section ( ".bss16" ) ))			\
36
+	_data16_ ## variable array __asm__ ( #variable )
37
+
30
 #define __text16( variable )						\
38
 #define __text16( variable )						\
31
 	__attribute__ (( section ( ".text16.data" ) ))			\
39
 	__attribute__ (( section ( ".text16.data" ) ))			\
32
 	_text16_ ## variable __asm__ ( #variable )
40
 	_text16_ ## variable __asm__ ( #variable )

Loading…
Cancel
Save