Fix x86 dynamic linker build.

Change-Id: Ia9fc6342e3d409de86dcd187c7402e8ac2ae96c8
This commit is contained in:
Elliott Hughes
2012-12-18 18:13:19 -08:00
parent a4ebdcf5bd
commit 45288c5ce3
2 changed files with 6 additions and 5 deletions

View File

@@ -26,14 +26,15 @@
* SUCH DAMAGE.
*/
#include <stdint.h>
extern unsigned __linker_init(unsigned int *elfdata);
__attribute__((visibility("hidden")))
void _start() {
void *elfdata;
void (*start)(void);
elfdata = __builtin_frame_address(0) + sizeof(void *);
void* elfdata = (void*) ((uintptr_t) __builtin_frame_address(0) + sizeof(void*));
start = (void(*)(void))__linker_init(elfdata);
/* linker init returns (%eax) the _entry address in the main image */