Browse Source

[build] Fix building on Ubuntu 8.04

Not fully understood, but it seems that the LMA of bss sections matters
for some newer binutils builds.  Force all bss sections to have an LMA
at the end of the file, so that they don't interfere with other
sections.

The symptom was that objcopy -O binary -j .zinfo would extract the
.zinfo section from bin/xxx.tmp as a blob of the correct length, but
with zero contents.  This would then cause the [ZBIN] stage of the
build to fail.

Also explicitly state that .zinfo(.*) sections have @progbits, in case
some future assembler or linker variant decides to omit them.
tags/v0.9.6
Michael Brown 15 years ago
parent
commit
04f3206581

+ 1
- 1
src/arch/i386/prefix/dskprefix.S View File

@@ -145,7 +145,7 @@ got_sectors:
145 145
 	ljmp	$SYSSEG, $start_runtime
146 146
 
147 147
 endseg:	.word SYSSEG + _filesz_pgh
148
-	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
148
+	.section ".zinfo.fixup", "a", @progbits	/* Compressor fixups */
149 149
 	.ascii	"SUBW"
150 150
 	.long	endseg
151 151
 	.long	16

+ 1
- 1
src/arch/i386/prefix/hdprefix.S View File

@@ -65,7 +65,7 @@ max_head:
65 65
 load_length:
66 66
 	.long	_filesz_sect
67 67
 	
68
-	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
68
+	.section ".zinfo.fixup", "a", @progbits	/* Compressor fixups */
69 69
 	.ascii	"SUBL"
70 70
 	.long	load_length
71 71
 	.long	512

+ 2
- 2
src/arch/i386/prefix/libprefix.S View File

@@ -679,7 +679,7 @@ prot_call_vector:
679 679
 
680 680
 	/* File split information for the compressor */
681 681
 #if COMPRESS
682
-	.section ".zinfo", "a"
682
+	.section ".zinfo", "a", @progbits
683 683
 	.ascii	"COPY"
684 684
 	.long	_prefix_lma
685 685
 	.long	_prefix_filesz
@@ -697,7 +697,7 @@ prot_call_vector:
697 697
 	.long	_textdata_filesz
698 698
 	.long	_max_align
699 699
 #else /* COMPRESS */
700
-	.section ".zinfo", "a"
700
+	.section ".zinfo", "a", @progbits
701 701
 	.ascii	"COPY"
702 702
 	.long	_prefix_lma
703 703
 	.long	_filesz

+ 1
- 1
src/arch/i386/prefix/lkrnprefix.S View File

@@ -94,7 +94,7 @@ root_flags:
94 94
 syssize: 
95 95
 	.long	_filesz_pgh - PREFIXPGH
96 96
 
97
-	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
97
+	.section ".zinfo.fixup", "a", @progbits	/* Compressor fixups */
98 98
 	.ascii	"SUBL"
99 99
 	.long	syssize
100 100
 	.long	16

+ 1
- 1
src/arch/i386/prefix/nbiprefix.S View File

@@ -36,7 +36,7 @@ imglen:	.long	_filesz - 512
36 36
 memlen:	.long	_filesz - 512
37 37
 	.size	segment_header, . - segment_header
38 38
 
39
-	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
39
+	.section ".zinfo.fixup", "a", @progbits	/* Compressor fixups */
40 40
 	.ascii	"SUBL"
41 41
 	.long	imglen
42 42
 	.long	1

+ 2
- 2
src/arch/i386/prefix/romprefix.S View File

@@ -42,7 +42,7 @@ checksum:
42 42
 	.word	pnpheader
43 43
 	.size romheader, . - romheader
44 44
 	
45
-	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
45
+	.section ".zinfo.fixup", "a", @progbits	/* Compressor fixups */
46 46
 	.ascii	"SUBB"
47 47
 	.long	romheader_size
48 48
 	.long	512
@@ -69,7 +69,7 @@ pciheader_runtime_length:
69 69
 	.equ pciheader_len, . - pciheader
70 70
 	.size pciheader, . - pciheader
71 71
 	
72
-	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
72
+	.section ".zinfo.fixup", "a", @progbits	/* Compressor fixups */
73 73
 	.ascii	"SUBW"
74 74
 	.long	pciheader_image_length
75 75
 	.long	512

+ 8
- 6
src/arch/i386/scripts/i386.lds View File

@@ -34,7 +34,7 @@ SECTIONS {
34 34
 	*(.prefix)
35 35
 	*(.prefix.*)
36 36
 	_mprefix = .;
37
-    } .prefix_bss (NOLOAD) : {
37
+    } .prefix_bss (NOLOAD) : AT ( _end_lma ) {
38 38
 	_eprefix = .;
39 39
     }
40 40
     _prefix_filesz	= ABSOLUTE ( _mprefix - _prefix );
@@ -52,7 +52,7 @@ SECTIONS {
52 52
 	*(.text16)
53 53
 	*(.text16.*)
54 54
 	_mtext16 = .;
55
-    } .text16_bss (NOLOAD) : {
55
+    } .text16_bss (NOLOAD) : AT ( _end_lma ) {
56 56
 	_etext16 = .;
57 57
     }
58 58
     _text16_filesz	= ABSOLUTE ( _mtext16 - _text16 );
@@ -71,7 +71,7 @@ SECTIONS {
71 71
 	*(.data16)
72 72
 	*(.data16.*)
73 73
 	_mdata16 = .;
74
-    } .data16_bss (NOLOAD) : {
74
+    } .data16_bss (NOLOAD) : AT ( _end_lma ) {
75 75
 	*(.bss16)
76 76
 	*(.bss16.*)
77 77
 	*(.stack16)
@@ -98,7 +98,7 @@ SECTIONS {
98 98
 	*(.data.*)
99 99
 	*(SORT(.tbl.*))		/* Various tables.  See include/tables.h */
100 100
 	_mtextdata = .;
101
-    } .textdata_bss (NOLOAD) : {
101
+    } .textdata_bss (NOLOAD) : AT ( _end_lma ) {
102 102
 	*(.bss)
103 103
 	*(.bss.*)
104 104
 	*(COMMON)
@@ -119,7 +119,7 @@ SECTIONS {
119 119
 	*(.zinfo)
120 120
 	*(.zinfo.*)
121 121
 	_mzinfo = .;
122
-    } .zinfo_bss (NOLOAD) : {
122
+    } .zinfo_bss (NOLOAD) : AT ( _end_lma ) {
123 123
 	_ezinfo = .;
124 124
     }
125 125
     _zinfo_filesz	= ABSOLUTE ( _mzinfo - _zinfo );
@@ -130,7 +130,7 @@ SECTIONS {
130 130
      *
131 131
      */
132 132
 
133
-    .weak 0x0 : {
133
+    .weak 0x0 : AT ( _end_lma ) {
134 134
 	_weak = .;
135 135
 	*(.weak)
136 136
 	_eweak = .;
@@ -181,6 +181,8 @@ SECTIONS {
181 181
     .			+= _zinfo_filesz;
182 182
     .			= ALIGN ( _max_align );
183 183
 
184
+    _end_lma		= .;
185
+
184 186
     /*
185 187
      * Values calculated to save code from doing it
186 188
      *

Loading…
Cancel
Save