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   "s390x"
#define EM_S390_OLD   0xA390
#define RTLD_START   asm ("\n\.text\n\.align 4\n\.globl _start\n\.globl _dl_start_user\n\_start:\n\ lgr %r2,%r15\n\ # Alloc stack frame\n\ aghi %r15,-160\n\ # Set the back chain to zero\n\ xc 0(8,%r15),0(%r15)\n\ # Call _dl_start with %r2 pointing to arg on stack\n\ brasl %r14,_dl_start # call _dl_start\n\_dl_start_user:\n\ # Save the user entry point address in %r8.\n\ lgr %r8,%r2\n\ # Point %r12 at the GOT.\n\ larl %r12,_GLOBAL_OFFSET_TABLE_\n\ # See if we were run as a command with the executable file\n\ # name as an extra leading argument.\n\ lghi %r1,_dl_skip_args@GOT\n\ lg %r1,0(%r1,%r12)\n\ lgf %r1,0(%r1) # load _dl_skip_args\n\ # Get the original argument count.\n\ lg %r0,160(%r15)\n\ # Subtract _dl_skip_args from it.\n\ sgr %r0,%r1\n\ # Adjust the stack pointer to skip _dl_skip_args words.\n\ sllg %r1,%r1,3\n\ agr %r15,%r1\n\ # Set the back chain to zero again\n\ xc 0(8,%r15),0(%r15)\n\ # Store back the modified argument count.\n\ stg %r0,160(%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\ lghi %r2,_rtld_local@GOT\n\ lg %r2,0(%r2,%r12)\n\ lg %r2,0(%r2)\n\ lg %r3,160(%r15)\n\ la %r4,168(%r15)\n\ lgr %r5,%r3\n\ sllg %r5,%r5,3\n\ la %r5,176(%r5,%r15)\n\ brasl %r14,_dl_init_internal@PLT\n\ # Pass our finalizer function to the user in %r14, as per ELF ABI.\n\ lghi %r14,_dl_fini@GOT\n\ lg %r14,0(%r14,%r12)\n\ # Free stack frame\n\ aghi %r15,160\n\ # Jump to the user's entry point (saved in %r8).\n\ br %r8\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 DL_PLATFORM_INIT   dl_platform_init ()
#define ARCH_LA_PLTENTER   s390_64_gnu_pltenter
#define ARCH_LA_PLTEXIT   s390_64_gnu_pltexit

Functions

static int elf_machine_matches_host (const Elf64_Ehdr *ehdr)
static Elf64_Addr elf_machine_dynamic (void)
static Elf64_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_64_gnu_pltenter
#define ARCH_LA_PLTEXIT   s390_64_gnu_pltexit
#define DL_PLATFORM_INIT   dl_platform_init ()
#define ELF_MACHINE_NAME   "s390x"

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

#define ELF_MACHINE_NO_REL   1
#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\ lgr %r2,%r15\n\ # Alloc stack frame\n\ aghi %r15,-160\n\ # Set the back chain to zero\n\ xc 0(8,%r15),0(%r15)\n\ # Call _dl_start with %r2 pointing to arg on stack\n\ brasl %r14,_dl_start # call _dl_start\n\_dl_start_user:\n\ # Save the user entry point address in %r8.\n\ lgr %r8,%r2\n\ # Point %r12 at the GOT.\n\ larl %r12,_GLOBAL_OFFSET_TABLE_\n\ # See if we were run as a command with the executable file\n\ # name as an extra leading argument.\n\ lghi %r1,_dl_skip_args@GOT\n\ lg %r1,0(%r1,%r12)\n\ lgf %r1,0(%r1) # load _dl_skip_args\n\ # Get the original argument count.\n\ lg %r0,160(%r15)\n\ # Subtract _dl_skip_args from it.\n\ sgr %r0,%r1\n\ # Adjust the stack pointer to skip _dl_skip_args words.\n\ sllg %r1,%r1,3\n\ agr %r15,%r1\n\ # Set the back chain to zero again\n\ xc 0(8,%r15),0(%r15)\n\ # Store back the modified argument count.\n\ stg %r0,160(%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\ lghi %r2,_rtld_local@GOT\n\ lg %r2,0(%r2,%r12)\n\ lg %r2,0(%r2)\n\ lg %r3,160(%r15)\n\ la %r4,168(%r15)\n\ lgr %r5,%r3\n\ sllg %r5,%r5,3\n\ la %r5,176(%r5,%r15)\n\ brasl %r14,_dl_init_internal@PLT\n\ # Pass our finalizer function to the user in %r14, as per ELF ABI.\n\ lghi %r14,_dl_fini@GOT\n\ lg %r14,0(%r14,%r12)\n\ # Free stack frame\n\ aghi %r15,160\n\ # Jump to the user's entry point (saved in %r8).\n\ br %r8\n\");
#define RTLD_START_SPECIAL_INIT   /* nothing */

Function Documentation

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

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

{
  register Elf64_Addr *got;

  asm( "      larl   %0,_GLOBAL_OFFSET_TABLE_\n"
       : "=&a" (got) : : "0" );

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

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

{
  Elf64_Addr addr;

  asm( "   larl       %0,_dl_start\n"
       "   larl       1,_GLOBAL_OFFSET_TABLE_\n"
       "   lghi       2,_dl_start@GOT\n"
       "   slg        %0,0(2,1)"
       : "=&d" (addr) : : "1", "2" );
  return addr;
}
static int elf_machine_matches_host ( const Elf64_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] == ELFCLASS64;
}

Variable Documentation

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