소스 검색

Post-relocation functions use the generic table mechanism.

tags/v0.9.3
Michael Brown 19 년 전
부모
커밋
b9e72856b6
3개의 변경된 파일8개의 추가작업 그리고 10개의 파일을 삭제
  1. 4
    2
      src/arch/i386/core/relocate.c
  2. 4
    5
      src/arch/i386/include/relocate.h
  3. 0
    3
      src/arch/i386/scripts/i386.lds

+ 4
- 2
src/arch/i386/core/relocate.c 파일 보기

@@ -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 파일 보기

@@ -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 파일 보기

@@ -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…
취소
저장