Revision 46027c07

b/linux-user/main.c
45 45
/* for recent libc, we add these dummy symbols which are not declared
46 46
   when generating a linked object (bug in ld ?) */
47 47
#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined(CONFIG_STATIC)
48
long __preinit_array_start[0];
49
long __preinit_array_end[0];
50
long __init_array_start[0];
51
long __init_array_end[0];
52
long __fini_array_start[0];
53
long __fini_array_end[0];
48
asm(".globl __preinit_array_start\n"
49
    ".globl __preinit_array_end\n"
50
    ".globl __init_array_start\n"
51
    ".globl __init_array_end\n"
52
    ".globl __fini_array_start\n"
53
    ".globl __fini_array_end\n"
54
    ".section \".rodata\"\n"
55
    "__preinit_array_start:\n"
56
    "__preinit_array_end:\n"
57
    "__init_array_start:\n"
58
    "__init_array_end:\n"
59
    "__fini_array_start:\n"
60
    "__fini_array_end:\n"
61
    ".long 0\n");
54 62
#endif
55 63

  
56 64
/* XXX: on x86 MAP_GROWSDOWN only works if ESP <= address + 32, so
......
1975 1983
    /* Scan interp_prefix dir for replacement files. */
1976 1984
    init_paths(interp_prefix);
1977 1985

  
1986
#if defined(TARGET_I386)
1987
    /* must be done before cpu_init() for x86 XXX: suppress this hack
1988
       by adding a new parameter to cpu_init and by suppressing
1989
       cpu_xxx_register() */
1990
    if (cpu_model == NULL) {
1991
#ifdef TARGET_X86_64
1992
        cpu_model = "qemu64";
1993
#else
1994
        cpu_model = "qemu32";
1995
#endif
1996
    }
1997
    if (x86_find_cpu_by_name(cpu_model)) {
1998
        fprintf(stderr, "Unable to find x86 CPU definition\n");
1999
        exit(1);
2000
    }
2001
#endif
2002

  
1978 2003
    /* NOTE: we need to init the CPU at this stage to get
1979 2004
       qemu_host_page_size */
1980 2005
    env = cpu_init();

Also available in: Unified diff