Back to index

glibc  2.9
Defines | Functions | Variables
dl-machine.h File Reference
#include <entry.h>
#include <sgidefs.h>
#include <sys/asm.h>
#include <dl-tls.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define ELF_MACHINE_NAME   "MIPS"
#define OFFSET_GP_GOT   0x7ff0
#define _RTLD_PROLOGUE(entry)
#define _RTLD_EPILOGUE(entry)
#define ELF_MACHINE_JMP_SLOT   R_MIPS_JUMP_SLOT
#define elf_machine_type_class(type)
#define ELF_MACHINE_PLT_REL   1
#define DT_MIPS(x)   (DT_MIPS_##x - DT_LOPROC + DT_NUM)
#define ELF_MACHINE_DEBUG_SETUP(l, r)
#define VALID_ELF_ABIVERSION(ver)   (ver == 0 || ver == 2)
#define VALID_ELF_OSABI(osabi)   (osabi == ELFOSABI_SYSV)
#define VALID_ELF_HEADER(hdr, exp, size)
#define STRINGXP(X)   __STRING(X)
#define STRINGXV(X)   STRINGV_(X)
#define STRINGV_(...)   # __VA_ARGS__
#define ELF_MIPS_GNU_GOT1_MASK   0x8000000000000000L
#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info)
#define ELF_MACHINE_USER_ADDRESS_MASK   0x80000000UL
#define RTLD_START
#define ARCH_LA_PLTENTER   mips_o32_gnu_pltenter
#define ARCH_LA_PLTEXIT   mips_o32_gnu_pltexit

Functions

static int __attribute_used__ elf_machine_matches_host (const ElfW(Ehdr)*ehdr)
static ElfW (Addr)*elf_mips_got_from_gpreg(ElfW(Addr) gpreg)
static lookup_t const ElfW (Rel)*reloc

Variables

static lookup_t t

Define Documentation

#define _RTLD_EPILOGUE (   entry)
Value:
".end\t" __STRING(entry) "\n\t"                                \
       ".size\t" __STRING(entry) ", . - " __STRING(entry) "\n\t"

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

#define _RTLD_PROLOGUE (   entry)
Value:
".globl\t" __STRING(entry) "\n\t"                       \
       ".ent\t" __STRING(entry) "\n\t"                                \
       ".type\t" __STRING(entry) ", @function\n"               \
       __STRING(entry) ":\n\t"

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

#define ARCH_LA_PLTENTER   mips_o32_gnu_pltenter

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

#define ARCH_LA_PLTEXIT   mips_o32_gnu_pltexit

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

#define DT_MIPS (   x)    (DT_MIPS_##x - DT_LOPROC + DT_NUM)

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

#define ELF_MACHINE_BEFORE_RTLD_RELOC (   dynamic_info)

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

#define ELF_MACHINE_DEBUG_SETUP (   l,
  r 
)
Value:
do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
       *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \
       (ElfW(Addr)) (r); \
   } while (0)

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

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

#define ELF_MACHINE_NAME   "MIPS"

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

#define ELF_MACHINE_PLT_REL   1

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

Value:

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

#define ELF_MACHINE_USER_ADDRESS_MASK   0x80000000UL

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

#define ELF_MIPS_GNU_GOT1_MASK   0x8000000000000000L

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

#define OFFSET_GP_GOT   0x7ff0

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

#define RTLD_START
Value:
asm (\
       ".text\n\     " _RTLD_PROLOGUE(ENTRY_POINT) "\   " STRINGXV(SETUP_GPX($25)) "\n\    " STRINGXV(SETUP_GPX64($18,$25)) "\n\     # i386 ABI book says that the first entry of GOT holds\n\      # the address of the dynamic structure. Though MIPS ABI\n\     # doesn't say nothing about this, I emulate this here.\n\      " STRINGXP(PTR_LA) " $4, _DYNAMIC\n\      # Subtract OFFSET_GP_GOT\n\ " STRINGXP(PTR_S) " $4, -0x7ff0($28)\n\   move $4, $29\n\      " STRINGXP(PTR_SUBIU) " $29, 16\n\ \n\    " STRINGXP(PTR_LA) " $8, .Lcoff\n\ bltzal $8, .Lcoff\n\.Lcoff: " STRINGXP(PTR_SUBU) " $8, $31, $8\n\     \n\    " STRINGXP(PTR_LA) " $25, _dl_start\n\    " STRINGXP(PTR_ADDU) " $25, $8\n\  jalr $25\n\   \n\    " STRINGXP(PTR_ADDIU) " $29, 16\n\ # Get the value of label '_dl_start_user' in t9 ($25).\n\      " STRINGXP(PTR_LA) " $25, _dl_start_user\n\      " _RTLD_EPILOGUE(ENTRY_POINT) "\   \n\    \n\    " _RTLD_PROLOGUE(_dl_start_user) "\       " STRINGXP(SETUP_GP) "\n\   " STRINGXV(SETUP_GP64($18,_dl_start_user)) "\n\  move $16, $28\n\     # Save the user entry point address in a saved register.\n\    move $17, $2\n\      # See if we were run as a command with the executable file\n\  # name as an extra leading argument.\n\   lw $2, _dl_skip_args\n\     beq $2, $0, 1f\n\    # Load the original argument count.\n\    " STRINGXP(PTR_L) " $4, 0($29)\n\  # Subtract _dl_skip_args from it.\n\      subu $4, $2\n\       # Adjust the stack pointer to skip _dl_skip_args words.\n\     sll $2, " STRINGXP (PTRLOG) "\n\   " STRINGXP(PTR_ADDU) " $29, $2\n\  # Save back the modified argument count.\n\      " STRINGXP(PTR_S) " $4, 0($29)\n\1:       # Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env) \n\  " STRINGXP(PTR_L) " $4, _rtld_local\n\    " STRINGXP(PTR_L) /* or lw???  fixme */ " $5, 0($29)\n\ " STRINGXP(PTR_LA) " $6, " STRINGXP (PTRSIZE) "($29)\n\ sll $7, $5, " STRINGXP (PTRLOG) "\n\      " STRINGXP(PTR_ADDU) " $7, $7, $6\n\      " STRINGXP(PTR_ADDU) " $7, $7, " STRINGXP (PTRSIZE) " \n\      # Make sure the stack pointer is aligned for _dl_init_internal.\n\    and $2, $29, -2 * " STRINGXP(SZREG) "\n\  " STRINGXP(PTR_S) " $29, -" STRINGXP(SZREG) "($2)\n\    " STRINGXP(PTR_SUBIU) " $29, $2, 32\n\    " STRINGXP(SAVE_GP(16)) "\n\       # Call the function to run the initializers.\n\  jal _dl_init_internal\n\    # Restore the stack pointer for _start.\n\       " STRINGXP(PTR_L)  " $29, 32-" STRINGXP(SZREG) "($29)\n\       # Pass our finalizer function to the user in $2 as per ELF ABI.\n\    " STRINGXP(PTR_LA) " $2, _dl_fini\n\      # Jump to the user entry point.\n\ move $25, $17\n\     jr $25\n\t"\
       _RTLD_EPILOGUE(_dl_start_user)\
       ".previous"\
);

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

#define STRINGV_ (   ...)    # __VA_ARGS__

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

#define STRINGXP (   X)    __STRING(X)

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

#define STRINGXV (   X)    STRINGV_(X)

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

#define VALID_ELF_ABIVERSION (   ver)    (ver == 0 || ver == 2)

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

#define VALID_ELF_HEADER (   hdr,
  exp,
  size 
)
Value:

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

#define VALID_ELF_OSABI (   osabi)    (osabi == ELFOSABI_SYSV)

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


Function Documentation

static int __attribute_used__ elf_machine_matches_host ( const ElfW(Ehdr)*  ehdr) [inline, static]

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

{
#if _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIN32
  /* Don't link o32 and n32 together.  */
  if (((ehdr->e_flags & EF_MIPS_ABI2) != 0) != (_MIPS_SIM == _ABIN32))
    return 0;
#endif

  switch (ehdr->e_machine)
    {
    case EM_MIPS:
    case EM_MIPS_RS3_LE:
      return 1;
    default:
      return 0;
    }
}
static ElfW ( Addr  ) [inline, static]

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

{
  /* FIXME: the offset of gp from GOT may be system-dependent. */
  return (ElfW(Addr) *) (gpreg - OFFSET_GP_GOT);
}
static const ElfW ( Rel  )

Variable Documentation

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