summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2005-04-27 14:10:24 +0200
committerMichael Brown2005-04-27 14:10:24 +0200
commitb9e72856b616b093287f9956c906a88c49c32869 (patch)
tree12caf371c95468cab6f3bb06812fb69681235a9d /src
parentUse PREFIX_OBJECT to give the init_fn table variables meaningful names. (diff)
downloadipxe-b9e72856b616b093287f9956c906a88c49c32869.tar.gz
ipxe-b9e72856b616b093287f9956c906a88c49c32869.tar.xz
ipxe-b9e72856b616b093287f9956c906a88c49c32869.zip
Post-relocation functions use the generic table mechanism.
Diffstat (limited to 'src')
-rw-r--r--src/arch/i386/core/relocate.c6
-rw-r--r--src/arch/i386/include/relocate.h9
-rw-r--r--src/arch/i386/scripts/i386.lds3
3 files changed, 8 insertions, 10 deletions
diff --git a/src/arch/i386/core/relocate.c b/src/arch/i386/core/relocate.c
index 834bc7886..a24b4fd10 100644
--- a/src/arch/i386/core/relocate.c
+++ b/src/arch/i386/core/relocate.c
@@ -39,8 +39,10 @@ extern char _max_align[];
/* Linker symbols */
extern char _text[];
extern char _end[];
-extern struct post_reloc_fn post_reloc_fns[];
-extern struct post_reloc_fn post_reloc_fns_end[];
+
+/* Post-relocation function table */
+static struct post_reloc_fn post_reloc_fns[0] __table_start(post_reloc_fn);
+static struct post_reloc_fn post_reloc_fns_end[0] __table_end(post_reloc_fn);
static void relocate ( void ) {
unsigned long addr, eaddr, size;
diff --git a/src/arch/i386/include/relocate.h b/src/arch/i386/include/relocate.h
index 31965d4fb..a0f8bafd8 100644
--- a/src/arch/i386/include/relocate.h
+++ b/src/arch/i386/include/relocate.h
@@ -10,13 +10,12 @@ struct post_reloc_fn {
};
/* Use double digits to avoid problems with "10" < "9" on alphabetic sort */
-#define POST_RELOC_LIBRM "00"
+#define POST_RELOC_LIBRM 00
/* Macro for creating a post-relocation function table entry */
-#define POST_RELOC_FN( post_reloc_order, post_reloc_func ) \
- static struct post_reloc_fn post_reloc_functions \
- __attribute__ (( used, __section__( ".post_reloc_fns." \
- post_reloc_order ) )) = { \
+#define POST_RELOC_FN( order, post_reloc_func ) \
+ static struct post_reloc_fn PREFIX_OBJECT(post_reloc_fn__) \
+ __attribute__ (( used, __table_section(post_reloc_fn,order) )) = {\
.post_reloc = post_reloc_func, \
};
diff --git a/src/arch/i386/scripts/i386.lds b/src/arch/i386/scripts/i386.lds
index 89d2f62ab..d6ae9be3d 100644
--- a/src/arch/i386/scripts/i386.lds
+++ b/src/arch/i386/scripts/i386.lds
@@ -157,9 +157,6 @@ SECTIONS {
type_drivers = .;
*(.drivers.type)
type_drivers_end = .;
- post_reloc_fns = .;
- *(SORT(.post_reloc_fns.*))
- post_reloc_fns_end = .;
_progbits_end = .;
}