gold/
authorCary Coutant <ccoutant@google.com>
Tue, 30 Jul 2013 21:26:53 +0000 (21:26 +0000)
committerCary Coutant <ccoutant@google.com>
Tue, 30 Jul 2013 21:26:53 +0000 (21:26 +0000)
     * parameters.cc (Parameters::entry): Return target-specific entry
     symbol name.
     * target.h (Target::entry_symbol_name): New function.
     (Target_info::entry_symbol_name): New data member.

     * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
     (Target_arm_nacl::arm_nacl_info): Likewise.
     * i386.cc (Target_i386::i386_info): Likewise.
     (Target_i386_nacl::i386_nacl_info): Likewise.
     * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
     * sparc.cc (Target_sparc::sparc_info): Likewise.
     * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
     * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
     (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
     * testsuite/testfile.cc (Target_test::test_target_info): Likewise.

gold/ChangeLog
gold/arm.cc
gold/i386.cc
gold/parameters.cc
gold/powerpc.cc
gold/sparc.cc
gold/target.h
gold/testsuite/testfile.cc
gold/tilegx.cc
gold/x86_64.cc

index e6e75d39b92244afe33209ccdb87679e06ae4552..432b66deec41993696c0ec739b71e8826ec34d5e 100644 (file)
@@ -1,3 +1,19 @@
+2013-07-23  Cary Coutant  <ccoutant@google.com>
+
+       * parameters.cc (Parameters::entry): Return target-specific entry
+       symbol name.
+       * target.h (Target::entry_symbol_name): New function.
+       (Target_info::entry_symbol_name): New data member.
+
+       * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
+       * i386.cc (Target_i386::i386_info): Likewise.
+       (Target_i386_nacl::i386_nacl_info): Likewise.
+       * sparc.cc (Target_sparc::sparc_info): Likewise.
+       * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
+       * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
+       (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
+       * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
+
 2013-07-22  Sterling Augustine  <saugustine@google.com>
 
        * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
index c980c6b7df527dd857294d1aec9c6611ce8ee0c8..ddf928bf4cf8f76db714769c8c1e3fcdaefa7734 100644 (file)
@@ -2952,7 +2952,8 @@ const Target::Target_info Target_arm<big_endian>::arm_info =
   0,                   // small_common_section_flags
   0,                   // large_common_section_flags
   ".ARM.attributes",   // attributes_section
-  "aeabi"              // attributes_vendor
+  "aeabi",             // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 // Arm relocate functions class
@@ -12216,7 +12217,8 @@ const Target::Target_info Target_arm_nacl<big_endian>::arm_nacl_info =
   0,                   // small_common_section_flags
   0,                   // large_common_section_flags
   ".ARM.attributes",   // attributes_section
-  "aeabi"              // attributes_vendor
+  "aeabi",             // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 template<bool big_endian>
index 59ec88527aa89f2c0eaa627d521774ef6a82dbc2..b2279e701601a76d3d3ee4de6a94b477d196a4b1 100644 (file)
@@ -857,7 +857,8 @@ const Target::Target_info Target_i386::i386_info =
   0,                   // small_common_section_flags
   0,                   // large_common_section_flags
   NULL,                        // attributes_section
-  NULL                 // attributes_vendor
+  NULL,                        // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 // Get the GOT section, creating it if necessary.
@@ -3964,7 +3965,8 @@ const Target::Target_info Target_i386_nacl::i386_nacl_info =
   0,                   // small_common_section_flags
   0,                   // large_common_section_flags
   NULL,                        // attributes_section
-  NULL                 // attributes_vendor
+  NULL,                        // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 #define        NACLMASK        0xe0            // 32-byte alignment mask
index 27819908fe123d3f7a7ba57e030b4c8c3035e7ca..7410e7f8a7b0d534df64b63d329928f0c25450a9 100644 (file)
@@ -238,10 +238,7 @@ Parameters::entry() const
 {
   const char* ret = this->options().entry();
   if (ret == NULL)
-    {
-      // FIXME: Need to support target specific entry symbol.
-      ret = "_start";
-    }
+    ret = parameters->target().entry_symbol_name();
   return ret;
 }
 
index 7d383f74f41c7e3b59e23851b5938d896d2a6813..676aad6f1812717b5a58ee4b7d9ef802718fba95 100644 (file)
@@ -1219,7 +1219,8 @@ Target::Target_info Target_powerpc<32, true>::powerpc_info =
   0,                   // small_common_section_flags
   0,                   // large_common_section_flags
   NULL,                        // attributes_section
-  NULL                 // attributes_vendor
+  NULL,                        // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 template<>
@@ -1245,7 +1246,8 @@ Target::Target_info Target_powerpc<32, false>::powerpc_info =
   0,                   // small_common_section_flags
   0,                   // large_common_section_flags
   NULL,                        // attributes_section
-  NULL                 // attributes_vendor
+  NULL,                        // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 template<>
@@ -1271,7 +1273,8 @@ Target::Target_info Target_powerpc<64, true>::powerpc_info =
   0,                   // small_common_section_flags
   0,                   // large_common_section_flags
   NULL,                        // attributes_section
-  NULL                 // attributes_vendor
+  NULL,                        // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 template<>
@@ -1297,7 +1300,8 @@ Target::Target_info Target_powerpc<64, false>::powerpc_info =
   0,                   // small_common_section_flags
   0,                   // large_common_section_flags
   NULL,                        // attributes_section
-  NULL                 // attributes_vendor
+  NULL,                        // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 inline bool
index acb39cd5e360b868bf3ac42d7a6b0c6812a3a06b..2af09aee5b0a3ba58211c87ce52be04f16bdae34 100644 (file)
@@ -483,7 +483,8 @@ Target::Target_info Target_sparc<32, true>::sparc_info =
   0,                   // small_common_section_flags
   0,                   // large_common_section_flags
   NULL,                        // attributes_section
-  NULL                 // attributes_vendor
+  NULL,                        // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 template<>
@@ -509,7 +510,8 @@ Target::Target_info Target_sparc<64, true>::sparc_info =
   0,                   // small_common_section_flags
   0,                   // large_common_section_flags
   NULL,                        // attributes_section
-  NULL                 // attributes_vendor
+  NULL,                        // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 // We have to take care here, even when operating in little-endian
index 6523c0456edea79974c87486fcadb753585dd1f7..4c58d10ff24800ea2e095c7ce52c70a6ad8cec9c 100644 (file)
@@ -449,6 +449,11 @@ class Target
   gc_mark_symbol(Symbol_table* symtab, Symbol* sym) const
   { this->do_gc_mark_symbol(symtab, sym); }
 
+  // Return the name of the entry point symbol.
+  const char*
+  entry_symbol_name() const
+  { return this->pti_->entry_symbol_name; }
+
  protected:
   // This struct holds the constant information for a child class.  We
   // use a struct to avoid the overhead of virtual function calls for
@@ -502,6 +507,8 @@ class Target
     const char* attributes_section;
     // Vendor name of vendor attributes.
     const char* attributes_vendor;
+    // Name of the main entry point to the program.
+    const char* entry_symbol_name;
   };
 
   Target(const Target_info* pti)
index da3dc61790e1eb78008664c428e33c7eb7572e6d..f360e3d00b30a76e9f73b2778d743f33b9a433d9 100644 (file)
@@ -107,7 +107,8 @@ const Target::Target_info Target_test<size, big_endian>::test_target_info =
   0,                                   // small_common_section_flags
   0,                                   // large_common_section_flags
   NULL,                                        // attributes_section
-  NULL                                 // attributes_vendor
+  NULL,                                        // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 // The test targets.
index ab976405ca0c7a268d24dfa938d552ad07869075..c3918b92a424a3edef42bfe0beb8d096db55207d 100644 (file)
@@ -681,7 +681,8 @@ const Target::Target_info Target_tilegx<64, false>::tilegx_info =
   0,                    // small_common_section_flags
   0,                    // large_common_section_flags
   NULL,                 // attributes_section
-  NULL                  // attributes_vendor
+  NULL,                 // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 template<>
@@ -707,7 +708,8 @@ const Target::Target_info Target_tilegx<32, false>::tilegx_info =
   0,                    // small_common_section_flags
   0,                    // large_common_section_flags
   NULL,                 // attributes_section
-  NULL                  // attributes_vendor
+  NULL,                 // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 template<>
@@ -733,7 +735,8 @@ const Target::Target_info Target_tilegx<64, true>::tilegx_info =
   0,                    // small_common_section_flags
   0,                    // large_common_section_flags
   NULL,                 // attributes_section
-  NULL                  // attributes_vendor
+  NULL,                 // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 template<>
@@ -759,7 +762,8 @@ const Target::Target_info Target_tilegx<32, true>::tilegx_info =
   0,                    // small_common_section_flags
   0,                    // large_common_section_flags
   NULL,                 // attributes_section
-  NULL                  // attributes_vendor
+  NULL,                  // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 // tilegx relocation handlers
index 8f773bdfddc5feac8787484bd6f1637f8b99091c..4f4d612939b7e3554b6124534cb64add55b0e175 100644 (file)
@@ -1007,7 +1007,8 @@ const Target::Target_info Target_x86_64<64>::x86_64_info =
   0,                   // small_common_section_flags
   elfcpp::SHF_X86_64_LARGE,    // large_common_section_flags
   NULL,                        // attributes_section
-  NULL                 // attributes_vendor
+  NULL,                        // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 template<>
@@ -1033,7 +1034,8 @@ const Target::Target_info Target_x86_64<32>::x86_64_info =
   0,                   // small_common_section_flags
   elfcpp::SHF_X86_64_LARGE,    // large_common_section_flags
   NULL,                        // attributes_section
-  NULL                 // attributes_vendor
+  NULL,                        // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 // This is called when a new output section is created.  This is where
@@ -4597,7 +4599,8 @@ const Target::Target_info Target_x86_64_nacl<64>::x86_64_nacl_info =
   0,                   // small_common_section_flags
   elfcpp::SHF_X86_64_LARGE,    // large_common_section_flags
   NULL,                        // attributes_section
-  NULL                 // attributes_vendor
+  NULL,                        // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 template<>
@@ -4623,7 +4626,8 @@ const Target::Target_info Target_x86_64_nacl<32>::x86_64_nacl_info =
   0,                   // small_common_section_flags
   elfcpp::SHF_X86_64_LARGE,    // large_common_section_flags
   NULL,                        // attributes_section
-  NULL                 // attributes_vendor
+  NULL,                        // attributes_vendor
+  "_start"             // entry_symbol_name
 };
 
 #define        NACLMASK        0xe0            // 32-byte alignment mask.