yann@1: Fixes errors: yann@1: In file included from dynamic-link.h:21, yann@1: from dl-load.c:32: yann@1: ../sysdeps/i386/dl-machine.h:121: error: parse error before '.' token yann@1: ../sysdeps/i386/dl-machine.h:122: error: stray '@' in program yann@1: ../sysdeps/i386/dl-machine.h:125: error: syntax error at '#' token yann@1: ../sysdeps/i386/dl-machine.h:128: error: syntax error at '#' token yann@1: ../sysdeps/i386/dl-machine.h:129: error: syntax error at '#' token yann@1: ../sysdeps/i386/dl-machine.h:129: error: stray '`' in program yann@1: ../sysdeps/i386/dl-machine.h:129: error: missing terminating ' character yann@1: ... yann@1: ../sysdeps/i386/dl-machine.h:227:22: warning: character constant too long for its type yann@1: ../sysdeps/i386/dl-machine.h:209: error: stray '\' in program yann@1: ../sysdeps/i386/dl-machine.h:209: error: stray '\' in program yann@1: ../sysdeps/i386/dl-machine.h:209: error: stray '\' in program yann@1: ../sysdeps/i386/dl-machine.h:209: error: missing terminating " character yann@1: ../sysdeps/i386/dl-machine.h: In function `dl_platform_init': yann@1: ../sysdeps/i386/dl-machine.h:273: error: `_dl_platform' undeclared (first use in this function) yann@1: ../sysdeps/i386/dl-machine.h:273: error: (Each undeclared identifier is reported only once yann@1: ../sysdeps/i386/dl-machine.h:273: error: for each function it appears in.) yann@1: dl-load.c: In function `_dl_map_object_from_fd': yann@1: dl-load.c:1043: warning: use of cast expressions as lvalues is deprecated yann@1: dl-load.c:1043: warning: use of cast expressions as lvalues is deprecated yann@1: dl-load.c:1058: warning: use of cast expressions as lvalues is deprecated yann@1: dl-load.c:1058: warning: use of cast expressions as lvalues is deprecated yann@1: yann@1: dl-runtime.c:53: error: conflicting types for 'fixup' yann@1: ../sysdeps/i386/dl-machine.h:67: error: previous declaration of 'fixup' was here yann@1: dl-runtime.c:53: error: conflicting types for 'fixup' yann@1: ../sysdeps/i386/dl-machine.h:67: error: previous declaration of 'fixup' was here yann@1: dl-runtime.c:135: error: conflicting types for 'profile_fixup' yann@1: ../sysdeps/i386/dl-machine.h:70: error: previous declaration of 'profile_fixup' was here yann@1: dl-runtime.c:135: error: conflicting types for 'profile_fixup' yann@1: ../sysdeps/i386/dl-machine.h:70: error: previous declaration of 'profile_fixup' was here yann@1: ../sysdeps/i386/dl-machine.h:67: warning: 'fixup' declared `static' but never defined yann@1: ../sysdeps/i386/dl-machine.h:70: warning: 'profile_fixup' declared `static' but never defined yann@1: yann@1: Updated to repair breakage caused by unconditionally requiring ARCH_FIXUP_ATTRIBUTE yann@1: to be defined. (No wonder glibc-2.2.2 didn't build for anything but x86...) yann@1: yann@1: =================================================================== yann@1: --- glibc-2.2.2/sysdeps/i386/dl-machine.h.old 2005-04-11 17:45:13.000000000 -0700 yann@1: +++ glibc-2.2.2/sysdeps/i386/dl-machine.h 2005-04-12 10:01:47.000000000 -0700 yann@1: @@ -63,11 +63,14 @@ yann@1: destroys the passed register information. */ yann@1: /* GKM FIXME: Fix trampoline to pass bounds so we can do yann@1: without the `__unbounded' qualifier. */ yann@1: + yann@1: +#define ARCH_FIXUP_ATTRIBUTE __attribute__ ((regparm (3), unused)) yann@1: + yann@1: static ElfW(Addr) fixup (struct link_map *__unbounded l, ElfW(Word) reloc_offset) yann@1: - __attribute__ ((regparm (2), unused)); yann@1: + ARCH_FIXUP_ATTRIBUTE; yann@1: static ElfW(Addr) profile_fixup (struct link_map *l, ElfW(Word) reloc_offset, yann@1: ElfW(Addr) retaddr) yann@1: - __attribute__ ((regparm (3), unused)); yann@1: + ARCH_FIXUP_ATTRIBUTE; yann@1: #endif yann@1: yann@1: /* Set up the loaded object described by L so its unrelocated PLT yann@1: @@ -117,68 +120,68 @@ yann@1: and then redirect to the address it returns. */ yann@1: #if !defined PROF && !__BOUNDED_POINTERS__ yann@1: # define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\ yann@1: - .text yann@1: - .globl _dl_runtime_resolve yann@1: - .type _dl_runtime_resolve, @function yann@1: - .align 16 yann@1: -_dl_runtime_resolve: yann@1: - pushl %eax # Preserve registers otherwise clobbered. yann@1: - pushl %ecx yann@1: - pushl %edx yann@1: - movl 16(%esp), %edx # Copy args pushed by PLT in register. Note yann@1: - movl 12(%esp), %eax # that `fixup' takes its parameters in regs. yann@1: - call fixup # Call resolver. yann@1: - popl %edx # Get register content back. yann@1: - popl %ecx yann@1: - xchgl %eax, (%esp) # Get %eax contents end store function address. yann@1: - ret $8 # Jump to function address. yann@1: - .size _dl_runtime_resolve, .-_dl_runtime_resolve yann@1: - yann@1: - .globl _dl_runtime_profile yann@1: - .type _dl_runtime_profile, @function yann@1: - .align 16 yann@1: -_dl_runtime_profile: yann@1: - pushl %eax # Preserve registers otherwise clobbered. yann@1: - pushl %ecx yann@1: - pushl %edx yann@1: - movl 20(%esp), %ecx # Load return address yann@1: - movl 16(%esp), %edx # Copy args pushed by PLT in register. Note yann@1: - movl 12(%esp), %eax # that `fixup' takes its parameters in regs. yann@1: - call profile_fixup # Call resolver. yann@1: - popl %edx # Get register content back. yann@1: - popl %ecx yann@1: - xchgl %eax, (%esp) # Get %eax contents end store function address. yann@1: - ret $8 # Jump to function address. yann@1: - .size _dl_runtime_profile, .-_dl_runtime_profile yann@1: - .previous yann@1: + .text\n\ yann@1: + .globl _dl_runtime_resolve\n\ yann@1: + .type _dl_runtime_resolve, @function\n\ yann@1: + .align 16\n\ yann@1: +_dl_runtime_resolve:\n\ yann@1: + pushl %eax # Preserve registers otherwise clobbered.\n\ yann@1: + pushl %ecx\n\ yann@1: + pushl %edx\n\ yann@1: + movl 16(%esp), %edx # Copy args pushed by PLT in register. Note\n\ yann@1: + movl 12(%esp), %eax # that `fixup' takes its parameters in regs.\n\ yann@1: + call fixup # Call resolver.\n\ yann@1: + popl %edx # Get register content back.\n\ yann@1: + popl %ecx\n\ yann@1: + xchgl %eax, (%esp) # Get %eax contents end store function address.\n\ yann@1: + ret $8 # Jump to function address.\n\ yann@1: + .size _dl_runtime_resolve, .-_dl_runtime_resolve\n\ yann@1: +\n\ yann@1: + .globl _dl_runtime_profile\n\ yann@1: + .type _dl_runtime_profile, @function\n\ yann@1: + .align 16\n\ yann@1: +_dl_runtime_profile:\n\ yann@1: + pushl %eax # Preserve registers otherwise clobbered.\n\ yann@1: + pushl %ecx\n\ yann@1: + pushl %edx\n\ yann@1: + movl 20(%esp), %ecx # Load return address\n\ yann@1: + movl 16(%esp), %edx # Copy args pushed by PLT in register. Note\n\ yann@1: + movl 12(%esp), %eax # that `fixup' takes its parameters in regs.\n\ yann@1: + call profile_fixup # Call resolver.\n\ yann@1: + popl %edx # Get register content back.\n\ yann@1: + popl %ecx\n\ yann@1: + xchgl %eax, (%esp) # Get %eax contents end store function address.\n\ yann@1: + ret $8 # Jump to function address.\n\ yann@1: + .size _dl_runtime_profile, .-_dl_runtime_profile\n\ yann@1: + .previous\n\ yann@1: "); yann@1: #else yann@1: -# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\ yann@1: - .text yann@1: - .globl _dl_runtime_resolve yann@1: - .globl _dl_runtime_profile yann@1: - .type _dl_runtime_resolve, @function yann@1: - .type _dl_runtime_profile, @function yann@1: - .align 16 yann@1: -_dl_runtime_resolve: yann@1: -_dl_runtime_profile: yann@1: - pushl %eax # Preserve registers otherwise clobbered. yann@1: - pushl %ecx yann@1: - pushl %edx yann@1: - movl 16(%esp), %edx # Push the arguments for `fixup' yann@1: - movl 12(%esp), %eax yann@1: - pushl %edx yann@1: - pushl %eax yann@1: - call fixup # Call resolver. yann@1: - popl %edx # Pop the parameters yann@1: - popl %ecx yann@1: - popl %edx # Get register content back. yann@1: - popl %ecx yann@1: - xchgl %eax, (%esp) # Get %eax contents end store function address. yann@1: - ret $8 # Jump to function address. yann@1: - .size _dl_runtime_resolve, .-_dl_runtime_resolve yann@1: - .size _dl_runtime_profile, .-_dl_runtime_profile yann@1: - .previous yann@1: +# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\n\ yann@1: + .text\n\ yann@1: + .globl _dl_runtime_resolve\n\ yann@1: + .globl _dl_runtime_profile\n\ yann@1: + .type _dl_runtime_resolve, @function\n\ yann@1: + .type _dl_runtime_profile, @function\n\ yann@1: + .align 16\n\ yann@1: +_dl_runtime_resolve:\n\ yann@1: +_dl_runtime_profile:\n\ yann@1: + pushl %eax # Preserve registers otherwise clobbered.\n\ yann@1: + pushl %ecx\n\ yann@1: + pushl %edx\n\ yann@1: + movl 16(%esp), %edx # Push the arguments for `fixup'\n\ yann@1: + movl 12(%esp), %eax\n\ yann@1: + pushl %edx\n\ yann@1: + pushl %eax\n\ yann@1: + call fixup # Call resolver.\n\ yann@1: + popl %edx # Pop the parameters\n\ yann@1: + popl %ecx\n\ yann@1: + popl %edx # Get register content back.\n\ yann@1: + popl %ecx\n\ yann@1: + xchgl %eax, (%esp) # Get %eax contents end store function address.\n\ yann@1: + ret $8 # Jump to function address.\n\ yann@1: + .size _dl_runtime_resolve, .-_dl_runtime_resolve\n\ yann@1: + .size _dl_runtime_profile, .-_dl_runtime_profile\n\ yann@1: + .previous\n\ yann@1: "); yann@1: #endif yann@1: yann@1: @@ -205,7 +208,7 @@ yann@1: _dl_start_user:\n\ yann@1: # Save the user entry point address in %edi.\n\ yann@1: movl %eax, %edi\n\ yann@1: - # Point %ebx at the GOT. yann@1: + # Point %ebx at the GOT.\n\ yann@1: call 0b\n\ yann@1: addl $_GLOBAL_OFFSET_TABLE_, %ebx\n\ yann@1: # Store the highest stack address\n\ yann@1: yann@1: =================================================================== yann@1: --- glibc-2.2.2/elf/dl-runtime.c.old 2005-07-07 15:40:26.000000000 -0700 yann@1: +++ glibc-2.2.2/elf/dl-runtime.c 2005-07-07 15:41:57.000000000 -0700 yann@1: @@ -33,6 +33,11 @@ yann@1: # define VERSYMIDX(sym) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (sym)) yann@1: #endif yann@1: yann@1: +/* The fixup functions might have need special attributes. If none yann@1: + are provided define the macro as empty. */ yann@1: +#ifndef ARCH_FIXUP_ATTRIBUTE yann@1: +# define ARCH_FIXUP_ATTRIBUTE yann@1: +#endif yann@1: yann@1: /* This function is called through a special trampoline from the PLT the yann@1: first time each PLT entry is called. We must perform the relocation yann@1: @@ -42,7 +47,7 @@ yann@1: function. */ yann@1: yann@1: #ifndef ELF_MACHINE_NO_PLT yann@1: -static ElfW(Addr) __attribute__ ((unused)) yann@1: +static ElfW(Addr) __attribute__ ((unused)) ARCH_FIXUP_ATTRIBUTE yann@1: fixup ( yann@1: # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS yann@1: ELF_MACHINE_RUNTIME_FIXUP_ARGS, yann@1: @@ -126,7 +131,7 @@ yann@1: yann@1: #if !defined PROF && !defined ELF_MACHINE_NO_PLT && !__BOUNDED_POINTERS__ yann@1: yann@1: -static ElfW(Addr) __attribute__ ((unused)) yann@1: +static ElfW(Addr) __attribute__ ((unused)) ARCH_FIXUP_ATTRIBUTE yann@1: profile_fixup ( yann@1: #ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS yann@1: ELF_MACHINE_RUNTIME_FIXUP_ARGS,