are usually many many terabytes away. */
Elf64_Addr dot;
- long zero_disp;
+ long int zero_disp;
asm("br %0, 1f\n\t"
".weak __load_address_undefined\n\t"
/* If the first instruction of the plt entry is not
"br $28, plt0", we cannot do lazy relocation. */
- lazy = (*(unsigned *)(plt + 32) == 0xc39ffff7);
+ lazy = (*(unsigned int *)(plt + 32) == 0xc39ffff7);
}
return lazy;
/* Fix up the instructions of a PLT entry to invoke the function
rather than the dynamic linker. */
-static inline void
-elf_machine_fixup_plt(struct link_map *l, const Elf64_Rela *reloc,
- Elf64_Addr *got_addr, Elf64_Addr value)
+static inline Elf64_Addr
+elf_machine_fixup_plt (struct link_map *l, lookup_t t,
+ const Elf64_Rela *reloc,
+ Elf64_Addr *got_addr, Elf64_Addr value)
{
const Elf64_Rela *rela_plt;
Elf64_Word *plte;
- long edisp;
+ long int edisp;
/* Store the value we are going to load. */
*got_addr = value;
plte += 3 * (reloc - rela_plt);
/* Find the displacement from the plt entry to the function. */
- edisp = (long)(value - (Elf64_Addr)&plte[3]) / 4;
+ edisp = (long int) (value - (Elf64_Addr)&plte[3]) / 4;
if (edisp >= -0x100000 && edisp < 0x100000)
{
int hi, lo;
hi = value - (Elf64_Addr)&plte[0];
- lo = (short)hi;
+ lo = (short int) hi;
hi = (hi - lo) >> 16;
/* Emit "lda $27,lo($27)" */
This will be taken care of in _dl_runtime_resolve. If instead we are
doing this as part of non-lazy startup relocation, that bit of code
hasn't made it into Icache yet, so there's nothing to clean up. */
+
+ return value;
}
/* Return the final value of a plt relocation. */
const struct r_found_version *version,
Elf64_Addr *const reloc_addr)
{
- unsigned long const r_type = ELF64_R_TYPE (reloc->r_info);
+ unsigned long int const r_type = ELF64_R_TYPE (reloc->r_info);
#ifndef RTLD_BOOTSTRAP
/* This is defined in rtld.c, but nowhere in the static libc.a; make the
Elf64_Addr l_addr, const Elf64_Rela *reloc)
{
Elf64_Addr * const reloc_addr = (void *)(l_addr + reloc->r_offset);
- unsigned long const r_type = ELF64_R_TYPE (reloc->r_info);
+ unsigned long int const r_type = ELF64_R_TYPE (reloc->r_info);
if (r_type == R_ALPHA_JMP_SLOT)
{
_dl_platform = NULL;
}
-static inline void
-elf_machine_fixup_plt (struct link_map *map, const Elf32_Rel *reloc,
+static inline Elf32_Addr
+elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const Elf32_Rel *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
- *reloc_addr = value;
+ return *reloc_addr = value;
}
/* Return the final value of a plt relocation. */
/* Fixup a PLT entry to bounce directly to the function at VALUE. */
-static inline void
-elf_machine_fixup_plt (struct link_map *map, const Elf32_Rel *reloc,
+static inline Elf32_Addr
+elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const Elf32_Rel *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
- *reloc_addr = value;
+ return *reloc_addr = value;
}
/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
/* Machine-dependent ELF dynamic relocation inline functions. i386 version.
- Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
+ Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
_dl_platform = NULL;
}
-static inline void
-elf_machine_fixup_plt (struct link_map *map, const Elf32_Rel *reloc,
+static inline Elf32_Addr
+elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const Elf32_Rel *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
- *reloc_addr = value;
+ return *reloc_addr = value;
}
/* Return the final value of a plt relocation. */
/* The m68k never uses Elf32_Rel relocations. */
#define ELF_MACHINE_NO_REL 1
-static inline void
-elf_machine_fixup_plt (struct link_map *map, const Elf32_Rela *reloc,
+static inline Elf32_Addr
+elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
- *reloc_addr = value;
+ return *reloc_addr = value;
}
/* Return the final value of a plt relocation. On the m68k the JMP_SLOT
/* Machine-dependent ELF dynamic relocation inline functions. PowerPC version.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
static inline Elf32_Addr
elf_machine_load_address (void)
{
- unsigned *got;
- unsigned *branchaddr;
+ unsigned int *got;
+ unsigned int *branchaddr;
/* This is much harder than you'd expect. Possibly I'm missing something.
The 'obvious' way:
}
/* Change the PLT entry whose reloc is 'reloc' to call the actual routine. */
-extern void __elf_machine_fixup_plt(struct link_map *map,
- const Elf32_Rela *reloc,
- Elf32_Addr *reloc_addr,
- Elf32_Addr finaladdr);
-#define elf_machine_fixup_plt __elf_machine_fixup_plt
+extern Elf32_Addr __elf_machine_fixup_plt (struct link_map *map,
+ const Elf32_Rela *reloc,
+ Elf32_Addr *reloc_addr,
+ Elf32_Addr finaladdr);
+
+static inline Elf32_Addr
+elf_machine_fixup_plt (struct link_map *l, lookup_t t,
+ const Elf32_Rela *reloc,
+ Elf32_Addr *reloc_addr, Elf64_Addr value)
+{
+ __elf_machine_fixup_plt (map, reloc, reloc_addr, finaladdr);
+ return value;
+}
/* Return the final value of a plt relocation. */
static inline Elf32_Addr
.size _dl_start_user, . - _dl_start_user
.previous");
-static inline void
-elf_machine_fixup_plt (struct link_map *map, const Elf32_Rela *reloc,
+static inline Elf32_Addr
+elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
#ifndef RTLD_BOOTSTRAP
reloc_addr[1] = OPCODE_SETHI_G1 | (value >> 10);
if (do_flush)
__asm __volatile ("flush %0+4" : : "r"(reloc_addr));
+
+ return value;
}
/* Return the final value of a plt relocation. */
/* We have 4 cases to handle. And we code different code sequences
for each one. I love V9 code models... */
-static inline void
-elf_machine_fixup_plt(struct link_map *map, const Elf64_Rela *reloc,
- Elf64_Addr *reloc_addr, Elf64_Addr value)
+static inline Elf64_Addr
+elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const Elf64_Rela *reloc,
+ Elf64_Addr *reloc_addr, Elf64_Addr value)
{
unsigned int *insns = (unsigned int *) reloc_addr;
Elf64_Addr plt_vaddr = (Elf64_Addr) reloc_addr;
insns[1] = 0x03000000 | (high32 >> 10);
__asm __volatile ("flush %0 + 4" : : "r" (insns));
}
+
+ return value;
}
/* Return the final value of a plt relocation. */