mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-15 07:41:45 +00:00
Post-relocation functions use the generic table mechanism.
This commit is contained in:
parent
d2d4978f4f
commit
b9e72856b6
@ -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;
|
||||
|
@ -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, \
|
||||
};
|
||||
|
||||
|
@ -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 = .;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user