Define prototype for exit and ensure references
Define a prototype for exit in stand.h. Provide a reference to exit in a few conf.c files to ensure that its definition gets pulled in early. Since exit() is a MD routine, it isn't defined in libsa. However, libsa tends to be listed last and will soon have panic() in it which calls exit(). The reference to exit early ensures that the MD exit is available to satisfy linking for static libraries.
This commit is contained in:
parent
74db99d940
commit
787ebc8eb3
@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$");
|
||||
#include "dev_net.h"
|
||||
#endif
|
||||
|
||||
/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */
|
||||
void (*exitfn)(int) = exit;
|
||||
|
||||
struct devsw *devsw[] = {
|
||||
#if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT)
|
||||
&uboot_storage,
|
||||
|
@ -376,6 +376,7 @@ extern int null_readdir(struct open_file *f, struct dirent *d);
|
||||
* Machine dependent functions and data, must be provided or stubbed by
|
||||
* the consumer
|
||||
*/
|
||||
extern void exit(int);
|
||||
extern int getchar(void);
|
||||
extern int ischar(void);
|
||||
extern void putchar(int);
|
||||
|
@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$");
|
||||
#include "dev_net.h"
|
||||
#endif
|
||||
|
||||
/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */
|
||||
void (*exitfn)(int) = exit;
|
||||
|
||||
struct devsw *devsw[] = {
|
||||
#if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT)
|
||||
&uboot_storage,
|
||||
|
@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$");
|
||||
#include "dev_net.h"
|
||||
#endif
|
||||
|
||||
/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */
|
||||
void (*exitfn)(int) = exit;
|
||||
|
||||
/*
|
||||
* We could use linker sets for some or all of these, but
|
||||
* then we would have to control what ended up linked into
|
||||
|
@ -35,6 +35,9 @@ __FBSDID("$FreeBSD$");
|
||||
#include "dev_net.h"
|
||||
#endif
|
||||
|
||||
/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */
|
||||
void (*exitfn)(int) = exit;
|
||||
|
||||
/*
|
||||
* We could use linker sets for some or all of these, but
|
||||
* then we would have to control what ended up linked into
|
||||
|
Loading…
Reference in New Issue
Block a user