Преглед на файлове

get rid of arch-specific defines in dl-startup.c and make each arch declare its requirements about initial bootstrapping

Mike Frysinger преди 20 години
родител
ревизия
efed1986bc
променени са 3 файла, в които са добавени 12 реда и са изтрити 3 реда
  1. 5 0
      ldso/ldso/cris/dl-startup.h
  2. 3 3
      ldso/ldso/dl-startup.c
  3. 4 0
      ldso/ldso/mips/dl-startup.h

+ 5 - 0
ldso/ldso/cris/dl-startup.h

@@ -26,6 +26,11 @@ asm(""					\
  * do something a little more subtle here.  */
 #define GET_ARGV(ARGVP, ARGS) ARGVP = (((unsigned long *) ARGS)+1)
 
+
+/* We can't call functions earlier in the dl startup process */
+#define NO_FUNCS_BEFORE_BOOTSTRAP
+
+
 /* Handle relocation of the symbols in the dynamic loader. */
 static inline
 void PERFORM_BOOTSTRAP_RELOC(ELF_RELOC *rpnt, unsigned long *reloc_addr,

+ 3 - 3
ldso/ldso/dl-startup.c

@@ -200,7 +200,7 @@ static void * __attribute_used__ _dl_start(unsigned long args)
 	   We are only doing ourself right now - we will have to do the rest later */
 	SEND_STDERR_DEBUG("Scanning DYNAMIC section ... ");
 	tpnt->dynamic_addr = dpnt;
-#if defined(__mips__) || defined(__cris__)
+#if defined(NO_FUNCS_BEFORE_BOOTSTRAP)
 	/* Some architectures cannot call functions here, must inline */
 	__dl_parse_dynamic_info(dpnt, tpnt->dynamic_info, NULL, load_addr);
 #else
@@ -209,10 +209,10 @@ static void * __attribute_used__ _dl_start(unsigned long args)
 
 	SEND_STDERR_DEBUG("DONE !\n");
 
-#if defined(__mips__)
+#if defined(PERFORM_BOOTSTRAP_GOT)
 
 	SEND_STDERR_DEBUG("About to do specific GOT bootstrap\n");
-	/* For MIPS we have to do stuff to the GOT before we do relocations.  */
+	/* some arches (like MIPS) we have to tweak the GOT before relocations */
 	PERFORM_BOOTSTRAP_GOT(tpnt);
 
 #else

+ 4 - 0
ldso/ldso/mips/dl-startup.h

@@ -70,6 +70,10 @@ asm(""
 #define GET_ARGV(ARGVP, ARGS) ARGVP = (((unsigned long *) ARGS)+1)
 
 
+/* We can't call functions earlier in the dl startup process */
+#define NO_FUNCS_BEFORE_BOOTSTRAP
+
+
 /*
  * Here is a macro to perform the GOT relocation. This is only
  * used when bootstrapping the dynamic loader.