• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Révision01b84e25533166047340c41a33cc29153e536227 (tree)
l'heure2016-03-19 06:54:35
AuteurVladimir Radosavljevic <vladimir.radosavljevic@imgt...>
CommiterCary Coutant

Message de Log

Remove is_n64_ data member from Mips_relobj class.

elfcpp/
* mips.h (abi_64): Remove.

gold/
* mips.cc (Mips_relobj::is_n64_): Remove.
(Target_mips::ei_class_): Likewise.
(Mips_relobj::is_newabi): Call methods.
(Mips_relobj::is_n64): Change checking for N64 ABI.
(Target_mips::is_output_n64): Likewise.
(Target_mips::merge_processor_specific_flags): Remove ei_class
argument, and remove comparing ei_class.
(Target_mips::do_adjust_elf_header): Remove setting EI_CLASS field
of the ELF header.
(Target_mips::do_finalize_sections): Don't pass ei_class argument
to merge_processor_specific_flags.
(Target_mips::elf_mips_abi_name): Remove ei_class argument, and
change checking for N64 ABI.

Change Summary

Modification

--- a/elfcpp/ChangeLog
+++ b/elfcpp/ChangeLog
@@ -1,3 +1,7 @@
1+2016-03-18 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
2+
3+ * mips.h (abi_64): Remove.
4+
15 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
26
37 * elfcpp_internal.h (Mips64_rel_data, Mips64_rela_data): Remove
--- a/elfcpp/mips.h
+++ b/elfcpp/mips.h
@@ -339,11 +339,6 @@ bool
339339 abi_n32(elfcpp::Elf_Word e_flags)
340340 { return (e_flags & elfcpp::EF_MIPS_ABI2) != 0; }
341341
342-// Whether the ABI is N64.
343-bool
344-abi_64(unsigned char ei_class)
345-{ return ei_class == elfcpp::ELFCLASS64; }
346-
347342 // Whether the file has microMIPS code.
348343 bool
349344 is_micromips(elfcpp::Elf_Word e_flags)
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,19 @@
1+2016-03-18 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
2+
3+ * mips.cc (Mips_relobj::is_n64_): Remove.
4+ (Target_mips::ei_class_): Likewise.
5+ (Mips_relobj::is_newabi): Call methods.
6+ (Mips_relobj::is_n64): Change checking for N64 ABI.
7+ (Target_mips::is_output_n64): Likewise.
8+ (Target_mips::merge_processor_specific_flags): Remove ei_class
9+ argument, and remove comparing ei_class.
10+ (Target_mips::do_adjust_elf_header): Remove setting EI_CLASS field
11+ of the ELF header.
12+ (Target_mips::do_finalize_sections): Don't pass ei_class argument
13+ to merge_processor_specific_flags.
14+ (Target_mips::elf_mips_abi_name): Remove ei_class argument, and
15+ change checking for N64 ABI.
16+
117 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
218
319 * mips.cc (enum Special_relocation_symbol): New enum type.
--- a/gold/mips.cc
+++ b/gold/mips.cc
@@ -1537,7 +1537,6 @@ class Mips_relobj : public Sized_relobj_file<size, big_endian>
15371537 {
15381538 this->is_pic_ = (ehdr.get_e_flags() & elfcpp::EF_MIPS_PIC) != 0;
15391539 this->is_n32_ = elfcpp::abi_n32(ehdr.get_e_flags());
1540- this->is_n64_ = elfcpp::abi_64(ehdr.get_e_ident()[elfcpp::EI_CLASS]);
15411540 }
15421541
15431542 ~Mips_relobj()
@@ -1694,12 +1693,12 @@ class Mips_relobj : public Sized_relobj_file<size, big_endian>
16941693 // Return whether the object uses N64 ABI.
16951694 bool
16961695 is_n64() const
1697- { return this->is_n64_; }
1696+ { return size == 64; }
16981697
16991698 // Return whether the object uses NewABI conventions.
17001699 bool
17011700 is_newabi() const
1702- { return this->is_n32_ || this->is_n64_; }
1701+ { return this->is_n32() || this->is_n64(); }
17031702
17041703 // Return Mips_got_info for this object.
17051704 Mips_got_info<size, big_endian>*
@@ -1848,8 +1847,6 @@ class Mips_relobj : public Sized_relobj_file<size, big_endian>
18481847 bool is_pic_ : 1;
18491848 // Whether the object uses N32 ABI.
18501849 bool is_n32_ : 1;
1851- // Whether the object uses N64 ABI.
1852- bool is_n64_ : 1;
18531850 // The Mips_got_info for this object.
18541851 Mips_got_info<size, big_endian>* got_info_;
18551852
@@ -3202,8 +3199,8 @@ class Target_mips : public Sized_target<size, big_endian>
32023199 : Sized_target<size, big_endian>(info), got_(NULL), gp_(NULL), plt_(NULL),
32033200 got_plt_(NULL), rel_dyn_(NULL), copy_relocs_(),
32043201 dyn_relocs_(), la25_stub_(NULL), mips_mach_extensions_(),
3205- mips_stubs_(NULL), ei_class_(0), mach_(0), layout_(NULL),
3206- got16_addends_(), entry_symbol_is_compressed_(false), insn32_(false)
3202+ mips_stubs_(NULL), mach_(0), layout_(NULL), got16_addends_(),
3203+ entry_symbol_is_compressed_(false), insn32_(false)
32073204 {
32083205 this->add_machine_extensions();
32093206 }
@@ -3485,14 +3482,10 @@ class Target_mips : public Sized_target<size, big_endian>
34853482 return elfcpp::abi_n32(this->processor_specific_flags());
34863483 }
34873484
3488- // Whether the output uses N64 ABI. This is valid only after
3489- // merge_processor_specific_flags() is called.
3485+ // Whether the output uses N64 ABI.
34903486 bool
34913487 is_output_n64() const
3492- {
3493- gold_assert(this->are_processor_specific_flags_set());
3494- return elfcpp::abi_64(this->ei_class_);
3495- }
3488+ { return size == 64; }
34963489
34973490 // Whether the output uses NEWABI. This is valid only after
34983491 // merge_processor_specific_flags() is called.
@@ -3860,8 +3853,7 @@ class Target_mips : public Sized_target<size, big_endian>
38603853
38613854 // Merge processor specific flags.
38623855 void
3863- merge_processor_specific_flags(const std::string&, elfcpp::Elf_Word,
3864- unsigned char, bool);
3856+ merge_processor_specific_flags(const std::string&, elfcpp::Elf_Word, bool);
38653857
38663858 // True if we are linking for CPUs that are faster if JAL is converted to BAL.
38673859 static inline bool
@@ -3940,7 +3932,7 @@ class Target_mips : public Sized_target<size, big_endian>
39403932 set_gp(Layout*, Symbol_table*);
39413933
39423934 const char*
3943- elf_mips_abi_name(elfcpp::Elf_Word e_flags, unsigned char ei_class);
3935+ elf_mips_abi_name(elfcpp::Elf_Word e_flags);
39443936 const char*
39453937 elf_mips_mach_name(elfcpp::Elf_Word e_flags);
39463938
@@ -4053,7 +4045,6 @@ class Target_mips : public Sized_target<size, big_endian>
40534045 // .MIPS.stubs
40544046 Mips_output_data_mips_stubs<size, big_endian>* mips_stubs_;
40554047
4056- unsigned char ei_class_;
40574048 unsigned int mach_;
40584049 Layout* layout_;
40594050
@@ -8352,14 +8343,12 @@ Target_mips<size, big_endian>::mips_mach_extends(unsigned int base,
83528343 template<int size, bool big_endian>
83538344 void
83548345 Target_mips<size, big_endian>::merge_processor_specific_flags(
8355- const std::string& name, elfcpp::Elf_Word in_flags,
8356- unsigned char in_ei_class, bool dyn_obj)
8346+ const std::string& name, elfcpp::Elf_Word in_flags, bool dyn_obj)
83578347 {
83588348 // If flags are not set yet, just copy them.
83598349 if (!this->are_processor_specific_flags_set())
83608350 {
83618351 this->set_processor_specific_flags(in_flags);
8362- this->ei_class_ = in_ei_class;
83638352 this->mach_ = this->elf_mips_mach(in_flags);
83648353 return;
83658354 }
@@ -8441,19 +8430,16 @@ Target_mips<size, big_endian>::merge_processor_specific_flags(
84418430 old_flags &= (~(elfcpp::EF_MIPS_ARCH | elfcpp::EF_MIPS_MACH
84428431 | elfcpp::EF_MIPS_32BITMODE));
84438432
8444- // Compare ABIs. The 64-bit ABI does not use EF_MIPS_ABI. But, it does set
8445- // EI_CLASS differently from any 32-bit ABI.
8446- if ((new_flags & elfcpp::EF_MIPS_ABI) != (old_flags & elfcpp::EF_MIPS_ABI)
8447- || (in_ei_class != this->ei_class_))
8433+ // Compare ABIs.
8434+ if ((new_flags & elfcpp::EF_MIPS_ABI) != (old_flags & elfcpp::EF_MIPS_ABI))
84488435 {
84498436 // Only error if both are set (to different values).
8450- if (((new_flags & elfcpp::EF_MIPS_ABI)
8437+ if ((new_flags & elfcpp::EF_MIPS_ABI)
84518438 && (old_flags & elfcpp::EF_MIPS_ABI))
8452- || (in_ei_class != this->ei_class_))
84538439 gold_error(_("%s: ABI mismatch: linking %s module with "
84548440 "previous %s modules"), name.c_str(),
8455- this->elf_mips_abi_name(in_flags, in_ei_class),
8456- this->elf_mips_abi_name(merged_flags, this->ei_class_));
8441+ this->elf_mips_abi_name(in_flags),
8442+ this->elf_mips_abi_name(merged_flags));
84578443
84588444 new_flags &= ~elfcpp::EF_MIPS_ABI;
84598445 old_flags &= ~elfcpp::EF_MIPS_ABI;
@@ -8501,16 +8487,13 @@ Target_mips<size, big_endian>::do_adjust_elf_header(
85018487 {
85028488 gold_assert(len == elfcpp::Elf_sizes<size>::ehdr_size);
85038489
8504- elfcpp::Ehdr<size, big_endian> ehdr(view);
8505- unsigned char e_ident[elfcpp::EI_NIDENT];
8506- memcpy(e_ident, ehdr.get_e_ident(), elfcpp::EI_NIDENT);
8507-
8508- e_ident[elfcpp::EI_CLASS] = this->ei_class_;
8490+ if (!this->entry_symbol_is_compressed_)
8491+ return;
85098492
8493+ elfcpp::Ehdr<size, big_endian> ehdr(view);
85108494 elfcpp::Ehdr_write<size, big_endian> oehdr(view);
8511- oehdr.put_e_ident(e_ident);
8512- if (this->entry_symbol_is_compressed_)
8513- oehdr.put_e_entry(ehdr.get_e_entry() + 1);
8495+
8496+ oehdr.put_e_entry(ehdr.get_e_entry() + 1);
85148497 }
85158498
85168499 // do_make_elf_object to override the same function in the base class.
@@ -8625,7 +8608,6 @@ Target_mips<size, big_endian>::do_finalize_sections(Layout* layout,
86258608
86268609 elfcpp::Ehdr<size, big_endian> ehdr(pehdr);
86278610 elfcpp::Elf_Word in_flags = ehdr.get_e_flags();
8628- unsigned char ei_class = ehdr.get_e_ident()[elfcpp::EI_CLASS];
86298611 // If all input sections will be discarded, don't use this object
86308612 // file for merging processor specific flags.
86318613 bool should_merge_processor_specific_flags = false;
@@ -8639,7 +8621,7 @@ Target_mips<size, big_endian>::do_finalize_sections(Layout* layout,
86398621
86408622 if (should_merge_processor_specific_flags)
86418623 this->merge_processor_specific_flags(relobj->name(), in_flags,
8642- ei_class, false);
8624+ false);
86438625 }
86448626 }
86458627
@@ -8657,10 +8639,8 @@ Target_mips<size, big_endian>::do_finalize_sections(Layout* layout,
86578639
86588640 elfcpp::Ehdr<size, big_endian> ehdr(pehdr);
86598641 elfcpp::Elf_Word in_flags = ehdr.get_e_flags();
8660- unsigned char ei_class = ehdr.get_e_ident()[elfcpp::EI_CLASS];
86618642
8662- this->merge_processor_specific_flags(dynobj->name(), in_flags, ei_class,
8663- true);
8643+ this->merge_processor_specific_flags(dynobj->name(), in_flags, true);
86648644 }
86658645
86668646 // Merge .reginfo contents of input objects.
@@ -11238,15 +11218,14 @@ Target_mips<size, big_endian>::Scan::unsupported_reloc_global(
1123811218 // Return printable name for ABI.
1123911219 template<int size, bool big_endian>
1124011220 const char*
11241-Target_mips<size, big_endian>::elf_mips_abi_name(elfcpp::Elf_Word e_flags,
11242- unsigned char ei_class)
11221+Target_mips<size, big_endian>::elf_mips_abi_name(elfcpp::Elf_Word e_flags)
1124311222 {
1124411223 switch (e_flags & elfcpp::EF_MIPS_ABI)
1124511224 {
1124611225 case 0:
1124711226 if ((e_flags & elfcpp::EF_MIPS_ABI2) != 0)
1124811227 return "N32";
11249- else if (elfcpp::abi_64(ei_class))
11228+ else if (size == 64)
1125011229 return "64";
1125111230 else
1125211231 return "none";