From dc0f822bfed430e5b4f87f27c2e63171fa5fba28 Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Tue, 2 Nov 2004 08:14:49 +0000 Subject: - Remove dynamic_size from struct elf_resolve. - Replace all open coded dynamic handling with a function. Reduces size. - Fold special MIPS dynamic code into the dynamic_info item. - Add RELRO support. - Support linking with "-z now". - prepare for DT_RELACOUNT/DT_RELCOUNT optimization. - Add -z now to ld.so linking, this is what ld.so does anyway so let the linker know that. --- ldso/ldso/mips/dl-startup.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'ldso/ldso/mips/dl-startup.h') diff --git a/ldso/ldso/mips/dl-startup.h b/ldso/ldso/mips/dl-startup.h index 3d9b829c3..0dd92b5ba 100644 --- a/ldso/ldso/mips/dl-startup.h +++ b/ldso/ldso/mips/dl-startup.h @@ -48,21 +48,21 @@ asm("" \ * Here is a macro to perform the GOT relocation. This is only * used when bootstrapping the dynamic loader. */ -#define PERFORM_BOOTSTRAP_GOT(got) \ +#define PERFORM_BOOTSTRAP_GOT(got, tpnt) \ do { \ Elf32_Sym *sym; \ unsigned long i; \ \ /* Add load address displacement to all local GOT entries */ \ i = 2; \ - while (i < tpnt->mips_local_gotno) \ + while (i < tpnt->dynamic_info[DT_MIPS_LOCAL_GOTNO_IDX]) \ got[i++] += load_addr; \ \ /* Handle global GOT entries */ \ - got += tpnt->mips_local_gotno; \ + got += tpnt->dynamic_info[DT_MIPS_LOCAL_GOTNO_IDX]; \ sym = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + \ - load_addr) + tpnt->mips_gotsym; \ - i = tpnt->mips_symtabno - tpnt->mips_gotsym; \ + load_addr) + tpnt->dynamic_info[DT_MIPS_GOTSYM_IDX]; \ + i = tpnt->dynamic_info[DT_MIPS_SYMTABNO_IDX] - tpnt->dynamic_info[DT_MIPS_GOTSYM_IDX];\ \ while (i--) { \ if (sym->st_shndx == SHN_UNDEF || \ @@ -91,8 +91,8 @@ do { \ #define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \ switch(ELF32_R_TYPE((RELP)->r_info)) { \ case R_MIPS_REL32: \ - if (symtab_index) { \ - if (symtab_index < tpnt->mips_gotsym) \ + if (SYMTAB) { \ + if (symtab_indexdynamic_info[DT_MIPS_GOTSYM_IDX])\ *REL += SYMBOL; \ } \ else { \ -- cgit v1.2.3