Add EM_IAMCU support to gold
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 13 Oct 2015 16:02:23 +0000 (09:02 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 13 Oct 2015 16:02:41 +0000 (09:02 -0700)
elfcpp/

PR gold/19118
* elfcpp.h (EM): Add EM_IAMCU.

gold/

PR gold/19118
* i386.cc (Target_iamcu): New class.
(Target_selector_iamcu): Likewise.
(Target_iamcu::iamcu_info): New variable.
(target_selector_iamcu): Likewise.

elfcpp/ChangeLog
elfcpp/elfcpp.h
gold/ChangeLog
gold/i386.cc

index 042d86ecbb2cedd878780bfcc945c9c2418a7abe..18c1d5a1f2886a433ced78a229c284816d2eba28 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gold/19118
+       * elfcpp.h (EM): Add EM_IAMCU.
+
 2015-10-02  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR gold/19060
index 70380a5a32a72549f3ad9ea0ab9744811f94ecc4..0e6833f60b3889e9eb1e36650194350fc2008f17 100644 (file)
@@ -173,7 +173,7 @@ enum EM
   EM_386 = 3,
   EM_68K = 4,
   EM_88K = 5,
-  // 6 used to be EM_486
+  EM_IAMCU = 6,
   EM_860 = 7,
   EM_MIPS = 8,
   EM_S370 = 9,
index e13392a1c8fb313d24c3ddb75a0fbc1db1f5ae6d..ff11c8890a07d974525ab537db70af3fe846b79e 100644 (file)
@@ -1,3 +1,11 @@
+2015-10-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gold/19118
+       * i386.cc (Target_iamcu): New class.
+       (Target_selector_iamcu): Likewise.
+       (Target_iamcu::iamcu_info): New variable.
+       (target_selector_iamcu): Likewise.
+
 2015-10-07  Andreas Schwab  <schwab@suse.de>
 
        * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
index 086314ee80831038ed109f64786c4a1c0414e8e1..202f518c3560a3cef613c1ec9f1a604d100237e1 100644 (file)
@@ -4252,4 +4252,60 @@ class Target_selector_i386_nacl
 
 Target_selector_i386_nacl target_selector_i386;
 
+// IAMCU variant.  It uses EM_IAMCU, not EM_386.
+
+class Target_iamcu : public Target_i386
+{
+ public:
+  Target_iamcu()
+    : Target_i386(&iamcu_info)
+  { }
+
+ private:
+  // Information about this specific target which we pass to the
+  // general Target structure.
+  static const Target::Target_info iamcu_info;
+};
+
+const Target::Target_info Target_iamcu::iamcu_info =
+{
+  32,                  // size
+  false,               // is_big_endian
+  elfcpp::EM_IAMCU,    // machine_code
+  false,               // has_make_symbol
+  false,               // has_resolve
+  true,                        // has_code_fill
+  true,                        // is_default_stack_executable
+  true,                        // can_icf_inline_merge_sections
+  '\0',                        // wrap_char
+  "/usr/lib/libc.so.1",        // dynamic_linker
+  0x08048000,          // default_text_segment_address
+  0x1000,              // abi_pagesize (overridable by -z max-page-size)
+  0x1000,              // common_pagesize (overridable by -z common-page-size)
+  false,                // isolate_execinstr
+  0,                    // rosegment_gap
+  elfcpp::SHN_UNDEF,   // small_common_shndx
+  elfcpp::SHN_UNDEF,   // large_common_shndx
+  0,                   // small_common_section_flags
+  0,                   // large_common_section_flags
+  NULL,                        // attributes_section
+  NULL,                        // attributes_vendor
+  "_start"             // entry_symbol_name
+};
+
+class Target_selector_iamcu : public Target_selector
+{
+public:
+  Target_selector_iamcu()
+    : Target_selector(elfcpp::EM_IAMCU, 32, false, "elf32-iamcu",
+                     "elf_iamcu")
+  { }
+
+  Target*
+  do_instantiate_target()
+  { return new Target_iamcu(); }
+};
+
+Target_selector_iamcu target_selector_iamcu;
+
 } // End anonymous namespace.