OSDN Git Service

* ldlang.c (entry_section): New initialised variable.
authorAlan Modra <amodra@bigpond.net.au>
Sun, 10 Feb 2002 10:55:23 +0000 (10:55 +0000)
committerAlan Modra <amodra@bigpond.net.au>
Sun, 10 Feb 2002 10:55:23 +0000 (10:55 +0000)
(lang_finish): Use it.
* ldlang.h (entry_section): Declare.
* emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Set
entry_section to ".opd".

ld/ChangeLog
ld/emultempl/ppc64elf.em
ld/ldlang.c
ld/ldlang.h

index a4fa7cc..4d0f866 100644 (file)
@@ -1,3 +1,11 @@
+2002-02-10  Alan Modra  <amodra@bigpond.net.au>
+
+       * ldlang.c (entry_section): New initialised variable.
+       (lang_finish): Use it.
+       * ldlang.h (entry_section): Declare.
+       * emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Set
+       entry_section to ".opd".
+
 2002-02-09  Chris Demetriou  <cgd@broadcom.com>
 
        * ld.texinfo (Options): Add back in -nostdlib documentation,
index 7e52434..27b20ce 100644 (file)
@@ -47,6 +47,11 @@ gld${EMULATION_NAME}_after_allocation ()
 static void
 gld${EMULATION_NAME}_finish ()
 {
+  /* e_entry on PowerPC64 points to the function descriptor for
+     _start.  If _start is missing, default to the first function
+     descriptor in the .opd section.  */
+  entry_section = ".opd";
+
   /* If generating a relocatable output file, then we don't have any
      stubs.  */
   if (link_info.relocateable)
index 456bc7f..bc705ad 100644 (file)
@@ -178,6 +178,7 @@ lang_statement_list_type lang_output_section_statement;
 lang_statement_list_type *stat_ptr = &statement_list;
 lang_statement_list_type file_chain = { NULL, NULL };
 const char *entry_symbol = NULL;
+const char *entry_section = ".text";
 boolean entry_from_cmdline;
 boolean lang_has_input_file = false;
 boolean had_output_filename = false;
@@ -3465,7 +3466,7 @@ lang_finish ()
 
          /* Can't find the entry symbol, and it's not a number.  Use
             the first address in the text section.  */
-         ts = bfd_get_section_by_name (output_bfd, ".text");
+         ts = bfd_get_section_by_name (output_bfd, entry_section);
          if (ts != (asection *) NULL)
            {
              if (warn)
index 7641992..5e50c5c 100644 (file)
@@ -356,6 +356,7 @@ extern lang_statement_list_type *stat_ptr;
 extern boolean delete_output_file_on_failure;
 
 extern const char *entry_symbol;
+extern const char *entry_section;
 extern boolean entry_from_cmdline;
 extern lang_statement_list_type file_chain;