Back to index

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

Go to the source code of this file.

Defines

#define ELF_MACHINE_NAME   "s390"
#define EM_S390_OLD   0xA390
#define ELF_MACHINE_USER_ADDRESS_MASK   0xf8000000UL
#define RTLD_START   asm ("\n\.text\n\.align 4\n\.globl _start\n\.globl _dl_start_user\n\_start:\n\ basr %r13,0\n\.L0: ahi %r13,.Llit-.L0\n\ lr %r2,%r15\n\ # Alloc stack frame\n\ ahi %r15,-96\n\ # Set the back chain to zero\n\ xc 0(4,%r15),0(%r15)\n\ # Call _dl_start with %r2 pointing to arg on stack\n\ l %r14,.Ladr1-.Llit(%r13)\n\ bas %r14,0(%r14,%r13) # call _dl_start\n\_dl_start_user:\n\ # Save the user entry point address in %r8.\n\ lr %r8,%r2\n\ # Point %r12 at the GOT.\n\ l %r12,.Ladr0-.Llit(%r13)\n\ ar %r12,%r13\n\ # See if we were run as a command with the executable file\n\ # name as an extra leading argument.\n\ l %r1,_dl_skip_args@GOT12(0,%r12)\n\ l %r1,0(%r1) # load _dl_skip_args\n\ # Get the original argument count.\n\ l %r0,96(%r15)\n\ # Subtract _dl_skip_args from it.\n\ sr %r0,%r1\n\ # Adjust the stack pointer to skip _dl_skip_args words.\n\ sll %r1,2\n\ ar %r15,%r1\n\ # Set the back chain to zero again\n\ xc 0(4,%r15),0(%r15)\n\ # Store back the modified argument count.\n\ st %r0,96(%r15)\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\ # Call the function to run the initializers.\n\ # Load the parameters:\n\ # (%r2, %r3, %r4, %r5) = (_dl_loaded, argc, argv, envp)\n\ l %r2,_rtld_local@GOT(%r12)\n\ l %r2,0(%r2)\n\ l %r3,96(%r15)\n\ la %r4,100(%r15)\n\ lr %r5,%r3\n\ sll %r5,2\n\ la %r5,104(%r5,%r15)\n\ l %r1,.Ladr4-.Llit(%r13)\n\ bas %r14,0(%r1,%r13)\n\ # Pass our finalizer function to the user in %r14, as per ELF ABI.\n\ l %r14,_dl_fini@GOT(%r12)\n\ # Free stack frame\n\ ahi %r15,96\n\ # Jump to the user's entry point (saved in %r8).\n\ br %r8\n\.Llit:\n\.Ladr0: .long _GLOBAL_OFFSET_TABLE_-.Llit\n\.Ladr1: .long _dl_start-.Llit\n\.Ladr4: .long _dl_init_internal@PLT-.Llit\n\");
#define RTLD_START_SPECIAL_INIT   /* nothing */
#define elf_machine_type_class(type)
#define ELF_MACHINE_JMP_SLOT   R_390_JMP_SLOT
#define ELF_MACHINE_NO_REL   1
#define ELF_MACHINE_PLTREL_OVERLAP   1
#define DL_PLATFORM_INIT   dl_platform_init ()
#define ARCH_LA_PLTENTER   s390_32_gnu_pltenter
#define ARCH_LA_PLTEXIT   s390_32_gnu_pltexit

Functions

static int elf_machine_matches_host (const Elf32_Ehdr *ehdr)
static Elf32_Addr elf_machine_dynamic (void)
static Elf32_Addr elf_machine_load_address (void)
static int __attribute__ ((unused)) elf_machine_runtime_setup(struct link_map *l

Variables

static int int lazy

Define Documentation

#define ARCH_LA_PLTENTER   s390_32_gnu_pltenter
#define ARCH_LA_PLTEXIT   s390_32_gnu_pltexit
#define DL_PLATFORM_INIT   dl_platform_init ()
#define ELF_MACHINE_NAME   "s390"

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

#define ELF_MACHINE_NO_REL   1
#define ELF_MACHINE_USER_ADDRESS_MASK   0xf8000000UL
#define EM_S390_OLD   0xA390

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

#define RTLD_START   asm ("\n\.text\n\.align 4\n\.globl _start\n\.globl _dl_start_user\n\_start:\n\ basr %r13,0\n\.L0: ahi %r13,.Llit-.L0\n\ lr %r2,%r15\n\ # Alloc stack frame\n\ ahi %r15,-96\n\ # Set the back chain to zero\n\ xc 0(4,%r15),0(%r15)\n\ # Call _dl_start with %r2 pointing to arg on stack\n\ l %r14,.Ladr1-.Llit(%r13)\n\ bas %r14,0(%r14,%r13) # call _dl_start\n\_dl_start_user:\n\ # Save the user entry point address in %r8.\n\ lr %r8,%r2\n\ # Point %r12 at the GOT.\n\ l %r12,.Ladr0-.Llit(%r13)\n\ ar %r12,%r13\n\ # See if we were run as a command with the executable file\n\ # name as an extra leading argument.\n\ l %r1,_dl_skip_args@GOT12(0,%r12)\n\ l %r1,0(%r1) # load _dl_skip_args\n\ # Get the original argument count.\n\ l %r0,96(%r15)\n\ # Subtract _dl_skip_args from it.\n\ sr %r0,%r1\n\ # Adjust the stack pointer to skip _dl_skip_args words.\n\ sll %r1,2\n\ ar %r15,%r1\n\ # Set the back chain to zero again\n\ xc 0(4,%r15),0(%r15)\n\ # Store back the modified argument count.\n\ st %r0,96(%r15)\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\ # Call the function to run the initializers.\n\ # Load the parameters:\n\ # (%r2, %r3, %r4, %r5) = (_dl_loaded, argc, argv, envp)\n\ l %r2,_rtld_local@GOT(%r12)\n\ l %r2,0(%r2)\n\ l %r3,96(%r15)\n\ la %r4,100(%r15)\n\ lr %r5,%r3\n\ sll %r5,2\n\ la %r5,104(%r5,%r15)\n\ l %r1,.Ladr4-.Llit(%r13)\n\ bas %r14,0(%r1,%r13)\n\ # Pass our finalizer function to the user in %r14, as per ELF ABI.\n\ l %r14,_dl_fini@GOT(%r12)\n\ # Free stack frame\n\ ahi %r15,96\n\ # Jump to the user's entry point (saved in %r8).\n\ br %r8\n\.Llit:\n\.Ladr0: .long _GLOBAL_OFFSET_TABLE_-.Llit\n\.Ladr1: .long _dl_start-.Llit\n\.Ladr4: .long _dl_init_internal@PLT-.Llit\n\");
#define RTLD_START_SPECIAL_INIT   /* nothing */

Function Documentation

static int __attribute__ ( (unused)  ) [inline, static]
static Elf32_Addr elf_machine_dynamic ( void  ) [inline, static]

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

{
  register Elf32_Addr *got;

  asm( "        bras   %0,2f\n"
       "1:      .long  _GLOBAL_OFFSET_TABLE_-1b\n"
       "2:      al     %0,0(%0)"
       : "=&a" (got) : : "0" );

  return *got;
}
static Elf32_Addr elf_machine_load_address ( void  ) [inline, static]

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

{
  Elf32_Addr addr;

  asm( "   bras  1,2f\n"
       "1: .long _GLOBAL_OFFSET_TABLE_ - 1b\n"
       "   .long _dl_start - 1b - 0x80000000\n"
       "2: l     %0,4(1)\n"
       "   ar    %0,1\n"
       "   al    1,0(1)\n"
       "   sl    %0,_dl_start@GOT12(1)"
       : "=&d" (addr) : : "1" );
  return addr;
}
static int elf_machine_matches_host ( const Elf32_Ehdr ehdr) [inline, static]

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

{
  return (ehdr->e_machine == EM_S390 || ehdr->e_machine == EM_S390_OLD)
         && ehdr->e_ident[EI_CLASS] == ELFCLASS32;
}

Variable Documentation

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