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

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

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

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

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

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

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

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

36
 memlen:	.long	_filesz - 512
36
 memlen:	.long	_filesz - 512
37
 	.size	segment_header, . - segment_header
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
 	.ascii	"SUBL"
40
 	.ascii	"SUBL"
41
 	.long	imglen
41
 	.long	imglen
42
 	.long	1
42
 	.long	1

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

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

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

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

Loading…
Cancel
Save