* SYMBOL is the symbol involved in the relocation, and LOAD is the
* load address.
*/
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
switch(ELF32_R_TYPE((RELP)->r_info)){ \
case R_ARM_ABS32: \
*REL += SYMBOL; \
* SYMBOL is the symbol involved in the relocation, and LOAD is the
* load address.
*/
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
switch(ELF32_R_TYPE((RELP)->r_info)){ \
case R_ARM_ABS32: \
*REL += SYMBOL; \
* SYMBOL is the symbol involved in the relocation, and LOAD is the
* load address.
*/
-#define PERFORM_BOOTSTRAP_RELOC(RELP, REL, SYMBOL, LOAD) \
+#define PERFORM_BOOTSTRAP_RELOC(RELP, REL, SYMBOL, LOAD, SYMTAB) \
switch (ELF32_R_TYPE((RELP)->r_info)) { \
case R_CRIS_GLOB_DAT: \
case R_CRIS_JUMP_SLOT: \
* SYMBOL is the symbol involved in the relocation, and LOAD is the
* load address.
*/
-#define PERFORM_BOOTSTRAP_RELOC(RELP, REL, SYMBOL, LOAD) \
+#define PERFORM_BOOTSTRAP_RELOC(RELP, REL, SYMBOL, LOAD, SYMTAB) \
switch (ELF32_R_TYPE((RELP)->r_info)) { \
case R_CRIS_GLOB_DAT: \
case R_CRIS_JUMP_SLOT: \
/*
* Initialization sequence for a GOT.
*/
-#define INIT_GOT(GOT_BASE,MODULE) \
-{ \
- GOT_BASE[2] = (unsigned long) _dl_linux_resolve; \
- GOT_BASE[1] = (unsigned long) MODULE; \
-}
+#define INIT_GOT(GOT_BASE,MODULE) \
+do { \
+ GOT_BASE[2] = (unsigned long) _dl_linux_resolve; \
+ GOT_BASE[1] = (unsigned long) MODULE; \
+} while(0)
/*
* Here is a macro to perform a relocation. This is only used when
* SYMBOL is the symbol involved in the relocation, and LOAD is the
* load address.
*/
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
- switch(ELF32_R_TYPE((RELP)->r_info)){ \
- case R_386_32: \
- *REL += SYMBOL; \
- break; \
- case R_386_PC32: \
- *REL += SYMBOL - (unsigned long) REL; \
- break; \
- case R_386_GLOB_DAT: \
- case R_386_JMP_SLOT: \
- *REL = SYMBOL; \
- break; \
- case R_386_RELATIVE: \
- *REL += (unsigned long) LOAD; \
- break; \
- default: \
- _dl_exit(1); \
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
+ switch(ELF32_R_TYPE((RELP)->r_info)){ \
+ case R_386_32: \
+ *REL += SYMBOL; \
+ break; \
+ case R_386_PC32: \
+ *REL += SYMBOL - (unsigned long) REL; \
+ break; \
+ case R_386_GLOB_DAT: \
+ case R_386_JMP_SLOT: \
+ *REL = SYMBOL; \
+ break; \
+ case R_386_RELATIVE: \
+ *REL += (unsigned long) LOAD; \
+ break; \
+ default: \
+ _dl_exit(1); \
}
* is done. This routine has to exit the current function, then
* call the _dl_elf_main function.
*/
-#define START() \
- __asm__ volatile ("leave\n\t" \
- "jmp *%%eax\n\t" \
+#define START() \
+ __asm__ volatile ("leave\n\t" \
+ "jmp *%%eax\n\t" \
: "=a" (status) : "a" (_dl_elf_main))
/*
* Initialization sequence for a GOT.
*/
-#define INIT_GOT(GOT_BASE,MODULE) \
-{ \
- GOT_BASE[2] = (unsigned long) _dl_linux_resolve; \
- GOT_BASE[1] = (unsigned long) MODULE; \
-}
+#define INIT_GOT(GOT_BASE,MODULE) \
+do { \
+ GOT_BASE[2] = (unsigned long) _dl_linux_resolve; \
+ GOT_BASE[1] = (unsigned long) MODULE; \
+} while(0)
/*
* Here is a macro to perform a relocation. This is only used when
* SYMBOL is the symbol involved in the relocation, and LOAD is the
* load address.
*/
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
- switch(ELF32_R_TYPE((RELP)->r_info)){ \
- case R_386_32: \
- *REL += SYMBOL; \
- break; \
- case R_386_PC32: \
- *REL += SYMBOL - (unsigned long) REL; \
- break; \
- case R_386_GLOB_DAT: \
- case R_386_JMP_SLOT: \
- *REL = SYMBOL; \
- break; \
- case R_386_RELATIVE: \
- *REL += (unsigned long) LOAD; \
- break; \
- default: \
- _dl_exit(1); \
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
+ switch(ELF32_R_TYPE((RELP)->r_info)){ \
+ case R_386_32: \
+ *REL += SYMBOL; \
+ break; \
+ case R_386_PC32: \
+ *REL += SYMBOL - (unsigned long) REL; \
+ break; \
+ case R_386_GLOB_DAT: \
+ case R_386_JMP_SLOT: \
+ *REL = SYMBOL; \
+ break; \
+ case R_386_RELATIVE: \
+ *REL += (unsigned long) LOAD; \
+ break; \
+ default: \
+ _dl_exit(1); \
}
* is done. This routine has to exit the current function, then
* call the _dl_elf_main function.
*/
-#define START() \
- __asm__ volatile ("leave\n\t" \
- "jmp *%%eax\n\t" \
+#define START() \
+ __asm__ volatile ("leave\n\t" \
+ "jmp *%%eax\n\t" \
: "=a" (status) : "a" (_dl_elf_main))
__asm__("\tbl _GLOBAL_OFFSET_TABLE_-4@local\n\t":"=l"(got));
#elif defined(__mips__)
__asm__("\tmove %0, $28\n\tsubu %0,%0,0x7ff0\n\t":"=r"(got));
-#elif defined(__sh__)
+#elif defined(__sh__) && !defined(__SH5__)
__asm__(
" mov.l 1f, %0\n"
" mova 1f, r0\n"
SEND_STDERR(strtab + symtab[symtab_index].st_name);
SEND_STDERR("\n");
#endif
+ PERFORM_BOOTSTRAP_RELOC(rpnt, reloc_addr, symbol_addr, load_addr, &symtab[symtab_index]);
+ } else {
+ /*
+ * Use this machine-specific macro to perform the actual relocation.
+ */
+ PERFORM_BOOTSTRAP_RELOC(rpnt, reloc_addr, symbol_addr, load_addr, NULL);
}
- /*
- * Use this machine-specific macro to perform the actual relocation.
- */
- PERFORM_BOOTSTRAP_RELOC(rpnt, reloc_addr, symbol_addr, load_addr);
}
}
are performing, REL is the pointer to the address we are
relocating. SYMBOL is the symbol involved in the relocation, and
LOAD is the load address. */
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
switch (ELF32_R_TYPE ((RELP)->r_info)) \
{ \
case R_68K_8: \
are performing, REL is the pointer to the address we are
relocating. SYMBOL is the symbol involved in the relocation, and
LOAD is the load address. */
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
switch (ELF32_R_TYPE ((RELP)->r_info)) \
{ \
case R_68K_8: \
* Here is a macro to perform a relocation. This is only used when
* bootstrapping the dynamic loader.
*/
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
switch(ELF32_R_TYPE((RELP)->r_info)) { \
case R_MIPS_REL32: \
if (symtab_index) { \
* Here is a macro to perform a relocation. This is only used when
* bootstrapping the dynamic loader.
*/
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
switch(ELF32_R_TYPE((RELP)->r_info)) { \
case R_MIPS_REL32: \
if (symtab_index) { \
* load address.
*/
// finaladdr = LOAD ?
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
{int type=ELF32_R_TYPE((RELP)->r_info); \
if(type==R_PPC_NONE){ \
}else if(type==R_PPC_ADDR32){ \
* load address.
*/
// finaladdr = LOAD ?
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
{int type=ELF32_R_TYPE((RELP)->r_info); \
if(type==R_PPC_NONE){ \
}else if(type==R_PPC_ADDR32){ \
* SYMBOL is the symbol involved in the relocation, and LOAD is the
* load address.
*/
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
switch(ELF32_R_TYPE((RELP)->r_info)){ \
case R_SH_REL32: \
*(REL) = (SYMBOL) + (RELP)->r_addend \
* SYMBOL is the symbol involved in the relocation, and LOAD is the
* load address.
*/
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
switch(ELF32_R_TYPE((RELP)->r_info)){ \
case R_SH_REL32: \
*(REL) = (SYMBOL) + (RELP)->r_addend \
* Here is a macro to perform a relocation. This is only used when
* bootstrapping the dynamic loader.
*/
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
switch(ELF32_R_TYPE((RELP)->r_info)) { \
case R_SPARC_32: \
*REL = SYMBOL + (RELP)->r_addend; \
* Here is a macro to perform a relocation. This is only used when
* bootstrapping the dynamic loader.
*/
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
switch(ELF32_R_TYPE((RELP)->r_info)) { \
case R_SPARC_32: \
*REL = SYMBOL + (RELP)->r_addend; \