summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-08-31 12:34:36 +0930
committerAlan Modra <amodra@gmail.com>2017-02-22 09:40:19 +1030
commitd817edc29c8249520601ac62054c78254bf18f97 (patch)
treeccdeccd602d22b47954f3b3d20aa090711653ca0
parent2ec4b4a8bc3b056b710710fc24ecdd19d6c9670a (diff)
downloadbinutils-gdb-d817edc29c8249520601ac62054c78254bf18f97.tar.gz
[GOLD] Add debug output for powerpc section grouping
* debug.h (DEBUG_TARGET): New. (DEBUG_ALL): Add DEBUG_TARGET. (gold_debug): Delete FORMAT param. * powerpc.cc (Stub_control::can_add_to_stub_group): Print debug ourput.
-rw-r--r--gold/ChangeLog6
-rw-r--r--gold/debug.h8
-rw-r--r--gold/powerpc.cc9
3 files changed, 20 insertions, 3 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 966aa2fc5af..24dcf16f9e7 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,6 +1,12 @@
2017-02-22 Alan Modra <amodra@gmail.com>
Apply from master
+ 2016-08-31 Alan Modra <amodra@gmail.com>
+ * debug.h (DEBUG_TARGET): New.
+ (DEBUG_ALL): Add DEBUG_TARGET.
+ (gold_debug): Delete FORMAT param.
+ * powerpc.cc (Stub_control::can_add_to_stub_group): Print debug ourput.
+
2016-08-30 Alan Modra <amodra@gmail.com>
PR 20523
* powerpc.cc (class Stub_control): Add has14_. Comment owner_.
diff --git a/gold/debug.h b/gold/debug.h
index e95408ffd9e..6fd72c2c1c8 100644
--- a/gold/debug.h
+++ b/gold/debug.h
@@ -39,10 +39,11 @@ const int DEBUG_FILES = 0x4;
const int DEBUG_RELAXATION = 0x8;
const int DEBUG_INCREMENTAL = 0x10;
const int DEBUG_LOCATION = 0x20;
+const int DEBUG_TARGET = 0x40;
const int DEBUG_ALL = (DEBUG_TASK | DEBUG_SCRIPT | DEBUG_FILES
| DEBUG_RELAXATION | DEBUG_INCREMENTAL
- | DEBUG_LOCATION);
+ | DEBUG_LOCATION | DEBUG_TARGET);
// Convert a debug string to the appropriate enum.
inline int
@@ -57,6 +58,7 @@ debug_string_to_enum(const char* arg)
{ "relaxation", DEBUG_RELAXATION },
{ "incremental", DEBUG_INCREMENTAL },
{ "location", DEBUG_LOCATION },
+ { "target", DEBUG_TARGET },
{ "all", DEBUG_ALL }
};
@@ -70,11 +72,11 @@ debug_string_to_enum(const char* arg)
// Print a debug message if TYPE is enabled. This is a macro so that
// we only evaluate the arguments if necessary.
-#define gold_debug(TYPE, FORMAT, ...) \
+#define gold_debug(TYPE, ...) \
do \
{ \
if (is_debugging_enabled(TYPE)) \
- parameters->errors()->debug(FORMAT, __VA_ARGS__); \
+ parameters->errors()->debug(__VA_ARGS__); \
} \
while (0)
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index d0dd6728e15..1d5cd97aee0 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -2522,6 +2522,13 @@ Stub_control::can_add_to_stub_group(Output_section* o,
i->relobj()->name().c_str(),
i->relobj()->section_name(i->shndx()).c_str());
+ gold_debug(DEBUG_TARGET, "maybe add%s %s:%s size=%#llx total=%#llx",
+ has14 ? " 14bit" : "",
+ i->relobj()->name().c_str(),
+ i->relobj()->section_name(i->shndx()).c_str(),
+ (long long) this_size,
+ (long long) this->group_end_addr_ - start_addr);
+
this->has14_ = this->has14_ || has14;
group_size = this->has14_ ? this->stub14_group_size_ : this->stub_group_size_;
@@ -2579,6 +2586,8 @@ Stub_control::can_add_to_stub_group(Output_section* o,
gold_unreachable();
}
+ gold_debug(DEBUG_TARGET, "nope, didn't fit\n");
+
// The section fails to fit in the current group. Set up a few
// things for the next group. owner_ and output_section_ will be
// set later after we've retrieved those values for the current