Back to index

glibc  2.9
Defines | Functions | Variables
dl-machine.h File Reference
#include <sys/param.h>

Go to the source code of this file.

Defines

#define ELF_MACHINE_NAME   "mn10300"
#define ELF_MACHINE_RUNTIME_TRAMPOLINE   asm ("\ .text\n\ .globl _dl_runtime_resolve\n\ .type _dl_runtime_resolve, @function\n\_dl_runtime_resolve:\n\ add -12,sp # Preserve registers otherwise clobbered.\n\ mov d1,(20,sp)\n\ mov d0,(16,sp)\n\ mov r1,d0\n\ mov r0,d1\n\ call fixup,[],0 # Call resolver.\n\ mov d0,a0\n\ mov (12,sp),d1 # Copy return address back to mdr,\n\ mov d1,mdr # in case the callee returns with retf\n\ mov (16,sp),d0 # Get register content back.\n\ mov (20,sp),d1\n\ add 12,sp\n\ jmp (a0)\n\ .size _dl_runtime_resolve, .-_dl_runtime_resolve\n\\n\ .globl _dl_runtime_profile\n\ .type _dl_runtime_profile, @function\n\_dl_runtime_profile:\n\ add -12,sp # Preserve registers otherwise clobbered.\n\ mov d1,(20,sp)\n\ mov d0,(16,sp)\n\ mov r1,d0\n\ mov r0,d1\n\ call profile_fixup,[],0 # Call resolver.\n\ mov d0,a0\n\ mov (12,sp),d1 # Copy return address back to mdr,\n\ mov d1,mdr # in case the callee returns with retf\n\ mov (16,sp),d0 # Get register content back.\n\ mov (20,sp),d1\n\ add 12,sp\n\ jmp (a0)\n\ .size _dl_runtime_profile, .-_dl_runtime_profile\n\ .previous\n\");
#define ELF_MACHINE_USER_ADDRESS_MASK   0xf8000000UL
#define RTLD_START   asm ("\n\ .text\n\.globl _start\n\.globl _dl_start_user\n\_start:\n\ mov 0,a3 # Mark the top of the stack\n\ mov sp,a1\n\ add -20,sp # Prepare for function call\n\ mov a1,d0\n\ call _dl_start,[],0\n\_dl_start_user:\n\ # Save the user entry point address in d2.\n\ mov d0,d2\n\ # Point a2 at the GOT.\n\0: mov pc,a2\n\ add _GLOBAL_OFFSET_TABLE_ - (0b-.),a2\n\ # Store the highest stack address\n\ mov (__libc_stack_end@GOT,a2),a0\n\ mov a1,(a0)\n\ # See if we were run as a command with the executable file\n\ # name as an extra leading argument.\n\ mov (_dl_skip_args@GOT,a2),a0\n\ mov (a0),d0\n\ # Pop the original argument count.\n\ mov (20,sp),d3\n\ # Subtract _dl_skip_args from it.\n\ sub d0,d3\n\ # Adjust the stack pointer to skip _dl_skip_args words.\n\ asl2 d0\n\ mov sp,a0\n\ add d0,a0\n\ mov a0,sp\n\ # Push argc back on the stack.\n\ mov d3,(20,sp)\n\ # The special initializer gets called with the stack just\n\ # as the application's entry point will see it; it can\n\ # switch stacks if it moves these contents over.\n\" RTLD_START_SPECIAL_INIT "\n\ # Load the parameters again.\n\ # (d0, d1, (12,sp), (16,sp)) = (_dl_loaded, argc, argv, envp)\n\ add 24,a0\n\ mov a0,(12,sp) # a0 is 24+sp\n\ mov d3,d1 # d3 contained argc\n\ inc d3\n\ asl2 d3 # d3 is now (argc+1)*4,\n\ add d3,a0 # the offset between argv and envp\n\ mov a0,(16,sp)\n\ mov (_rtld_local@GOTOFF,a2),d0\n\ # Call the function to run the initializers.\n\ call _dl_init@PLT,[],0\n\ # Pass our finalizer function to the user in d0, as per ELF ABI.\n\ mov (_dl_fini@GOT,a2),d0\n\ add 20,sp\n\ # Jump to the user's entry point.\n\ mov d2,a1\n\ jmp (a1)\n\ .previous\n\");
#define RTLD_START_SPECIAL_INIT   /* nothing */
#define elf_machine_type_class(type)
#define ELF_MACHINE_JMP_SLOT   R_MN10300_JMP_SLOT

Functions

static int __attribute__ ((unused)) elf_machine_matches_host(const Elf32_Ehdr *ehdr)
static ElfW (Addr) fixup(struct link_map *__unbounded l
static ElfW (Word) reloc_offset) __attribute__((unused))

Variables

static int int lazy

Define Documentation

#define ELF_MACHINE_NAME   "mn10300"

Definition at line 24 of file dl-machine.h.

#define ELF_MACHINE_RUNTIME_TRAMPOLINE   asm ("\ .text\n\ .globl _dl_runtime_resolve\n\ .type _dl_runtime_resolve, @function\n\_dl_runtime_resolve:\n\ add -12,sp # Preserve registers otherwise clobbered.\n\ mov d1,(20,sp)\n\ mov d0,(16,sp)\n\ mov r1,d0\n\ mov r0,d1\n\ call fixup,[],0 # Call resolver.\n\ mov d0,a0\n\ mov (12,sp),d1 # Copy return address back to mdr,\n\ mov d1,mdr # in case the callee returns with retf\n\ mov (16,sp),d0 # Get register content back.\n\ mov (20,sp),d1\n\ add 12,sp\n\ jmp (a0)\n\ .size _dl_runtime_resolve, .-_dl_runtime_resolve\n\\n\ .globl _dl_runtime_profile\n\ .type _dl_runtime_profile, @function\n\_dl_runtime_profile:\n\ add -12,sp # Preserve registers otherwise clobbered.\n\ mov d1,(20,sp)\n\ mov d0,(16,sp)\n\ mov r1,d0\n\ mov r0,d1\n\ call profile_fixup,[],0 # Call resolver.\n\ mov d0,a0\n\ mov (12,sp),d1 # Copy return address back to mdr,\n\ mov d1,mdr # in case the callee returns with retf\n\ mov (16,sp),d0 # Get register content back.\n\ mov (20,sp),d1\n\ add 12,sp\n\ jmp (a0)\n\ .size _dl_runtime_profile, .-_dl_runtime_profile\n\ .previous\n\");
#define ELF_MACHINE_USER_ADDRESS_MASK   0xf8000000UL
#define RTLD_START   asm ("\n\ .text\n\.globl _start\n\.globl _dl_start_user\n\_start:\n\ mov 0,a3 # Mark the top of the stack\n\ mov sp,a1\n\ add -20,sp # Prepare for function call\n\ mov a1,d0\n\ call _dl_start,[],0\n\_dl_start_user:\n\ # Save the user entry point address in d2.\n\ mov d0,d2\n\ # Point a2 at the GOT.\n\0: mov pc,a2\n\ add _GLOBAL_OFFSET_TABLE_ - (0b-.),a2\n\ # Store the highest stack address\n\ mov (__libc_stack_end@GOT,a2),a0\n\ mov a1,(a0)\n\ # See if we were run as a command with the executable file\n\ # name as an extra leading argument.\n\ mov (_dl_skip_args@GOT,a2),a0\n\ mov (a0),d0\n\ # Pop the original argument count.\n\ mov (20,sp),d3\n\ # Subtract _dl_skip_args from it.\n\ sub d0,d3\n\ # Adjust the stack pointer to skip _dl_skip_args words.\n\ asl2 d0\n\ mov sp,a0\n\ add d0,a0\n\ mov a0,sp\n\ # Push argc back on the stack.\n\ mov d3,(20,sp)\n\ # The special initializer gets called with the stack just\n\ # as the application's entry point will see it; it can\n\ # switch stacks if it moves these contents over.\n\" RTLD_START_SPECIAL_INIT "\n\ # Load the parameters again.\n\ # (d0, d1, (12,sp), (16,sp)) = (_dl_loaded, argc, argv, envp)\n\ add 24,a0\n\ mov a0,(12,sp) # a0 is 24+sp\n\ mov d3,d1 # d3 contained argc\n\ inc d3\n\ asl2 d3 # d3 is now (argc+1)*4,\n\ add d3,a0 # the offset between argv and envp\n\ mov a0,(16,sp)\n\ mov (_rtld_local@GOTOFF,a2),d0\n\ # Call the function to run the initializers.\n\ call _dl_init@PLT,[],0\n\ # Pass our finalizer function to the user in d0, as per ELF ABI.\n\ mov (_dl_fini@GOT,a2),d0\n\ add 20,sp\n\ # Jump to the user's entry point.\n\ mov d2,a1\n\ jmp (a1)\n\ .previous\n\");
#define RTLD_START_SPECIAL_INIT   /* nothing */

Function Documentation

static int __attribute__ ( (unused)  ) const [inline, static]

Definition at line 29 of file dl-machine.h.

{
  return ehdr->e_machine == EM_MN10300;
}
static ElfW ( Addr  ) [static]
static ElfW ( Word  )

Variable Documentation

Definition at line 80 of file dl-machine.h.