summaryrefslogtreecommitdiff
path: root/ldso/ldso/sparc/elfinterp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldso/ldso/sparc/elfinterp.c')
-rw-r--r--ldso/ldso/sparc/elfinterp.c58
1 files changed, 25 insertions, 33 deletions
diff --git a/ldso/ldso/sparc/elfinterp.c b/ldso/ldso/sparc/elfinterp.c
index 6f0d9f8fd..c69ef86f0 100644
--- a/ldso/ldso/sparc/elfinterp.c
+++ b/ldso/ldso/sparc/elfinterp.c
@@ -41,20 +41,12 @@ an ELF sharable library or a linux style of shared library. */
a more than adequate job of explaining everything required to get this
working. */
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <linux/unistd.h>
-/*#include <stdlib.h>*/
-#include "string.h"
-#include <linux/unistd.h>
-#include <linux/fcntl.h>
+#include <sys/types.h>
+#include "elf.h"
#include "hash.h"
-#include "linuxelf.h"
+#include "syscall.h"
+#include "string.h"
#include "sysdep.h"
-#include "../syscall.h"
-#include "../string.h"
-
-#define SVR4_COMPATIBILITY
extern char *_dl_progname;
@@ -63,10 +55,10 @@ extern _dl_linux_resolve(void);
unsigned int _dl_linux_resolver(unsigned int reloc_entry, unsigned int * plt)
{
int reloc_type;
- struct elf32_rela * this_reloc;
+ Elf32_Rela * this_reloc;
char * strtab;
- struct elf32_sym * symtab;
- struct elf32_rela * rel_addr;
+ Elf32_Sym * symtab;
+ Elf32_Rela * rel_addr;
struct elf_resolve * tpnt;
int symtab_index;
char * new_addr;
@@ -74,7 +66,7 @@ unsigned int _dl_linux_resolver(unsigned int reloc_entry, unsigned int * plt)
unsigned int instr_addr;
tpnt = (struct elf_resolve *) plt[2];
- rel_addr = (struct elf32_rela *) (tpnt->dynamic_info[DT_JMPREL] +
+ rel_addr = (Elf32_Rela *) (tpnt->dynamic_info[DT_JMPREL] +
tpnt->loadaddr);
/*
@@ -82,12 +74,12 @@ unsigned int _dl_linux_resolver(unsigned int reloc_entry, unsigned int * plt)
*/
reloc_entry = (reloc_entry >> 12) - 0xc;
- this_reloc = (struct elf32_rela *) ((char *) rel_addr + reloc_entry);
+ this_reloc = (Elf32_Rela *) ((char *) rel_addr + reloc_entry);
reloc_type = ELF32_R_TYPE(this_reloc->r_info);
symtab_index = ELF32_R_SYM(this_reloc->r_info);
- symtab = (struct elf32_sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
+ symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
_dl_fdprintf(2, "tpnt = %x\n", tpnt);
@@ -146,17 +138,17 @@ void _dl_parse_lazy_relocation_information(struct elf_resolve * tpnt, int rel_ad
char * strtab;
int reloc_type;
int symtab_index;
- struct elf32_sym * symtab;
- struct elf32_rela * rpnt;
+ Elf32_Sym * symtab;
+ Elf32_Rela * rpnt;
unsigned int * reloc_addr;
/* Now parse the relocation information */
- rpnt = (struct elf32_rela *) (rel_addr + tpnt->loadaddr);
+ rpnt = (Elf32_Rela *) (rel_addr + tpnt->loadaddr);
- symtab = (struct elf32_sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
+ symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
strtab = ( char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
- for(i=0; i< rel_size; i += sizeof(struct elf32_rela), rpnt++){
+ for(i=0; i< rel_size; i += sizeof(Elf32_Rela), rpnt++){
reloc_addr = (int *) (tpnt->loadaddr + (int)rpnt->r_offset);
reloc_type = ELF32_R_TYPE(rpnt->r_info);
symtab_index = ELF32_R_SYM(rpnt->r_info);
@@ -191,19 +183,19 @@ int _dl_parse_relocation_information(struct elf_resolve * tpnt, int rel_addr,
char * strtab;
int reloc_type;
int goof = 0;
- struct elf32_sym * symtab;
- struct elf32_rela * rpnt;
+ Elf32_Sym * symtab;
+ Elf32_Rela * rpnt;
unsigned int * reloc_addr;
unsigned int symbol_addr;
int symtab_index;
/* Now parse the relocation information */
- rpnt = (struct elf32_rela *) (rel_addr + tpnt->loadaddr);
+ rpnt = (Elf32_Rela *) (rel_addr + tpnt->loadaddr);
- symtab = (struct elf32_sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
+ symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
strtab = ( char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
- for(i=0; i< rel_size; i+= sizeof(struct elf32_rela), rpnt++){
+ for(i=0; i< rel_size; i+= sizeof(Elf32_Rela), rpnt++){
reloc_addr = (int *) (tpnt->loadaddr + (int)rpnt->r_offset);
reloc_type = ELF32_R_TYPE(rpnt->r_info);
symtab_index = ELF32_R_SYM(rpnt->r_info);
@@ -307,8 +299,8 @@ int _dl_parse_copy_information(struct dyn_elf * xpnt, int rel_addr,
char * strtab;
int reloc_type;
int goof = 0;
- struct elf32_sym * symtab;
- struct elf32_rela * rpnt;
+ Elf32_Sym * symtab;
+ Elf32_Rela * rpnt;
unsigned int * reloc_addr;
unsigned int symbol_addr;
struct elf_resolve *tpnt;
@@ -317,12 +309,12 @@ int _dl_parse_copy_information(struct dyn_elf * xpnt, int rel_addr,
tpnt = xpnt->dyn;
- rpnt = (struct elf32_rela *) (rel_addr + tpnt->loadaddr);
+ rpnt = (Elf32_Rela *) (rel_addr + tpnt->loadaddr);
- symtab = (struct elf32_sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
+ symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
strtab = ( char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
- for(i=0; i< rel_size; i+= sizeof(struct elf32_rela), rpnt++){
+ for(i=0; i< rel_size; i+= sizeof(Elf32_Rela), rpnt++){
reloc_addr = (int *) (tpnt->loadaddr + (int)rpnt->r_offset);
reloc_type = ELF32_R_TYPE(rpnt->r_info);
if(reloc_type != R_SPARC_COPY) continue;