summaryrefslogtreecommitdiff
path: root/ldso/ldso/avr32/elfinterp.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-11-27 01:58:40 -0500
committerMike Frysinger <vapier@gentoo.org>2012-03-25 01:55:43 -0400
commitc3393906d84d0d9cb7d688e0f2bbf8cde92190a2 (patch)
tree9ea8993348b94ba8d527eb7d49e6988055739708 /ldso/ldso/avr32/elfinterp.c
parent867bac0c750401d2f429ad6bb066498c3b8b35c1 (diff)
ldso: use ELF_xxx()/ElfW() helpers
They expand into the same code, but using the ELF_xxx()/ElfW() macros makes it much easier to spot similarities between code bases. Acked-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Acked-by: Carmelo Amoroso <carmelo.amoroso@st.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'ldso/ldso/avr32/elfinterp.c')
-rw-r--r--ldso/ldso/avr32/elfinterp.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/ldso/ldso/avr32/elfinterp.c b/ldso/ldso/avr32/elfinterp.c
index dd17fdc87..17f34fae8 100644
--- a/ldso/ldso/avr32/elfinterp.c
+++ b/ldso/ldso/avr32/elfinterp.c
@@ -34,7 +34,7 @@ unsigned long _dl_linux_resolver(unsigned long got_offset, unsigned long *got)
*/
#if 0
struct elf_resolve *tpnt = (struct elf_resolve *)got[1];
- Elf32_Sym *sym;
+ ElfW(Sym) *sym;
unsigned long local_gotno;
unsigned long gotsym;
unsigned long new_addr;
@@ -45,7 +45,7 @@ unsigned long _dl_linux_resolver(unsigned long got_offset, unsigned long *got)
local_gotno = tpnt->dynamic_info[DT_AVR32_LOCAL_GOTNO];
gotsym = tpnt->dynamic_info[DT_AVR32_GOTSYM];
- sym = ((Elf32_Sym *)(tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr))
+ sym = ((ElfW(Sym) *)(tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr))
+ sym_index;
strtab = (char *)(tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
symname = strtab + sym->st_name;
@@ -66,22 +66,22 @@ static int
_dl_parse(struct elf_resolve *tpnt, struct r_scope_elem *scope,
unsigned long rel_addr, unsigned long rel_size,
int (*reloc_func)(struct elf_resolve *tpnt, struct r_scope_elem *scope,
- Elf32_Rela *rpnt, Elf32_Sym *symtab, char *strtab))
+ ElfW(Rela) *rpnt, ElfW(Sym) *symtab, char *strtab))
{
- Elf32_Sym *symtab;
- Elf32_Rela *rpnt;
+ ElfW(Sym) *symtab;
+ ElfW(Rela) *rpnt;
char *strtab;
int i;
- rpnt = (Elf32_Rela *)rel_addr;
- rel_size /= sizeof(Elf32_Rela);
- symtab = (Elf32_Sym *)tpnt->dynamic_info[DT_SYMTAB];
+ rpnt = (ElfW(Rela) *)rel_addr;
+ rel_size /= sizeof(ElfW(Rela));
+ symtab = (ElfW(Sym) *)tpnt->dynamic_info[DT_SYMTAB];
strtab = (char *)tpnt->dynamic_info[DT_STRTAB];
for (i = 0; i < rel_size; i++, rpnt++) {
int symtab_index, res;
- symtab_index = ELF32_R_SYM(rpnt->r_info);
+ symtab_index = ELF_R_SYM(rpnt->r_info);
debug_sym(symtab, strtab, symtab_index);
debug_reloc(symtab, strtab, rpnt);
@@ -98,7 +98,7 @@ _dl_parse(struct elf_resolve *tpnt, struct r_scope_elem *scope,
strtab + symtab[symtab_index].st_name);
if (res < 0) {
- int reloc_type = ELF32_R_TYPE(rpnt->r_info);
+ int reloc_type = ELF_R_TYPE(rpnt->r_info);
#if defined(__SUPPORT_LD_DEBUG__)
_dl_dprintf(2, "can't handle reloc type %s\n",
_dl_reltypes(reloc_type));
@@ -117,7 +117,7 @@ _dl_parse(struct elf_resolve *tpnt, struct r_scope_elem *scope,
}
static int _dl_do_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope,
- Elf32_Rela *rpnt, Elf32_Sym *symtab, char *strtab)
+ ElfW(Rela) *rpnt, ElfW(Sym) *symtab, char *strtab)
{
int reloc_type;
int symtab_index;
@@ -130,8 +130,8 @@ static int _dl_do_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope,
struct symbol_ref sym_ref;
reloc_addr = (unsigned long *)(tpnt->loadaddr + rpnt->r_offset);
- reloc_type = ELF32_R_TYPE(rpnt->r_info);
- symtab_index = ELF32_R_SYM(rpnt->r_info);
+ reloc_type = ELF_R_TYPE(rpnt->r_info);
+ symtab_index = ELF_R_SYM(rpnt->r_info);
symbol_addr = 0;
sym_ref.sym = &symtab[symtab_index];
sym_ref.tpnt = NULL;
@@ -144,7 +144,7 @@ static int _dl_do_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope,
/* Allow undefined references to weak symbols */
if (!symbol_addr &&
- ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK) {
+ ELF_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK) {
_dl_dprintf(2, "%s: can't resolve symbol '%s'\n",
_dl_progname, symname);
return 0;