Browse Source

Post-relocation functions use the generic table mechanism.

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
b9e72856b6

+ 4
- 2
src/arch/i386/core/relocate.c View File

@@ -39,8 +39,10 @@ extern char _max_align[];
39 39
 /* Linker symbols */
40 40
 extern char _text[];
41 41
 extern char _end[];
42
-extern struct post_reloc_fn post_reloc_fns[];
43
-extern struct post_reloc_fn post_reloc_fns_end[];
42
+
43
+/* Post-relocation function table */
44
+static struct post_reloc_fn post_reloc_fns[0] __table_start(post_reloc_fn);
45
+static struct post_reloc_fn post_reloc_fns_end[0] __table_end(post_reloc_fn);
44 46
 
45 47
 static void relocate ( void ) {
46 48
 	unsigned long addr, eaddr, size;

+ 4
- 5
src/arch/i386/include/relocate.h View File

@@ -10,13 +10,12 @@ struct post_reloc_fn {
10 10
 };
11 11
 
12 12
 /* Use double digits to avoid problems with "10" < "9" on alphabetic sort */
13
-#define POST_RELOC_LIBRM	"00"
13
+#define POST_RELOC_LIBRM	00
14 14
 
15 15
 /* Macro for creating a post-relocation function table entry */
16
-#define POST_RELOC_FN( post_reloc_order, post_reloc_func )		      \
17
-	static struct post_reloc_fn post_reloc_functions		      \
18
-	    __attribute__ (( used, __section__( ".post_reloc_fns."	      \
19
-						post_reloc_order ) )) = {     \
16
+#define POST_RELOC_FN( order, post_reloc_func )				      \
17
+	static struct post_reloc_fn PREFIX_OBJECT(post_reloc_fn__)	      \
18
+	    __attribute__ (( used, __table_section(post_reloc_fn,order) )) = {\
20 19
 		.post_reloc = post_reloc_func,				      \
21 20
 	};
22 21
 

+ 0
- 3
src/arch/i386/scripts/i386.lds View File

@@ -157,9 +157,6 @@ SECTIONS {
157 157
 	type_drivers = .;
158 158
 	*(.drivers.type)
159 159
 	type_drivers_end = .;
160
-	post_reloc_fns = .;
161
-	*(SORT(.post_reloc_fns.*))
162
-	post_reloc_fns_end = .;
163 160
 
164 161
 	_progbits_end = .;
165 162
     }

Loading…
Cancel
Save