• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

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

Revisiónf9aa8e5d979f7b60ca37b331a1dacebcf5e89a4f (tree)
Tiempo2017-02-22 08:10:20
AutorAlan Modra <amodra@gmai...>
CommiterAlan Modra

Log Message

[GOLD] PowerPC stub debug

Some more debug output, and a little hardening.

* powerpc.cc (Stub_table_owner): Provide constructor.
(Powerpc_relobj::set_stub_table): Resize fill with -1.
(Target_powerpc::Branch_info::make_stub): Provide target debug
output on returning false.

Cambiar Resumen

Diferencia incremental

--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,6 +1,12 @@
11 2017-02-22 Alan Modra <amodra@gmail.com>
22
33 Apply from master
4+ 2016-12-07 Alan Modra <amodra@gmail.com>
5+ * powerpc.cc (Stub_table_owner): Provide constructor.
6+ (Powerpc_relobj::set_stub_table): Resize fill with -1.
7+ (Target_powerpc::Branch_info::make_stub): Provide target debug
8+ output on returning false.
9+
410 2016-12-01 Cary Coutant <ccoutant@gmail.com>
511 PR gold/20807
612 * aarch64.cc (Target_aarch64::scan_reloc_section_for_stubs): Handle
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -70,6 +70,10 @@ class Target_powerpc;
7070
7171 struct Stub_table_owner
7272 {
73+ Stub_table_owner()
74+ : output_section(NULL), owner(NULL)
75+ { }
76+
7377 Output_section* output_section;
7478 const Output_section::Input_section* owner;
7579 };
@@ -275,7 +279,7 @@ public:
275279 set_stub_table(unsigned int shndx, unsigned int stub_index)
276280 {
277281 if (shndx >= this->stub_table_index_.size())
278- this->stub_table_index_.resize(shndx + 1);
282+ this->stub_table_index_.resize(shndx + 1, -1);
279283 this->stub_table_index_[shndx] = stub_index;
280284 }
281285
@@ -2720,6 +2724,8 @@ Target_powerpc<size, big_endian>::Branch_info::make_stub(
27202724 Target_powerpc<size, big_endian>* target =
27212725 static_cast<Target_powerpc<size, big_endian>*>(
27222726 parameters->sized_target<size, big_endian>());
2727+ bool ok = true;
2728+
27232729 if (gsym != NULL
27242730 ? gsym->use_plt_offset(Scan::get_reference_flags(this->r_type_, target))
27252731 : this->object_->local_has_plt_offset(this->r_sym_))
@@ -2745,13 +2751,13 @@ Target_powerpc<size, big_endian>::Branch_info::make_stub(
27452751 from += (this->object_->output_section(this->shndx_)->address()
27462752 + this->offset_);
27472753 if (gsym != NULL)
2748- return stub_table->add_plt_call_entry(from,
2749- this->object_, gsym,
2750- this->r_type_, this->addend_);
2754+ ok = stub_table->add_plt_call_entry(from,
2755+ this->object_, gsym,
2756+ this->r_type_, this->addend_);
27512757 else
2752- return stub_table->add_plt_call_entry(from,
2753- this->object_, this->r_sym_,
2754- this->r_type_, this->addend_);
2758+ ok = stub_table->add_plt_call_entry(from,
2759+ this->object_, this->r_sym_,
2760+ this->r_type_, this->addend_);
27552761 }
27562762 }
27572763 else
@@ -2838,12 +2844,22 @@ Target_powerpc<size, big_endian>::Branch_info::make_stub(
28382844 && gsym != NULL
28392845 && gsym->source() == Symbol::IN_OUTPUT_DATA
28402846 && gsym->output_data() == target->savres_section());
2841- return stub_table->add_long_branch_entry(this->object_,
2842- this->r_type_,
2843- from, to, save_res);
2847+ ok = stub_table->add_long_branch_entry(this->object_,
2848+ this->r_type_,
2849+ from, to, save_res);
28442850 }
28452851 }
2846- return true;
2852+ if (!ok)
2853+ gold_debug(DEBUG_TARGET,
2854+ "branch at %s:%s+%#lx\n"
2855+ "can't reach stub attached to %s:%s",
2856+ this->object_->name().c_str(),
2857+ this->object_->section_name(this->shndx_).c_str(),
2858+ (unsigned long) this->offset_,
2859+ stub_table->relobj()->name().c_str(),
2860+ stub_table->relobj()->section_name(stub_table->shndx()).c_str());
2861+
2862+ return ok;
28472863 }
28482864
28492865 // Relaxation hook. This is where we do stub generation.