summaryrefslogtreecommitdiffstats
path: root/binutils-2.25
diff options
context:
space:
mode:
authorHan Shen <shenhan@google.com>2015-11-20 14:02:29 -0800
committerHan Shen <shenhan@google.com>2015-11-20 16:36:37 -0800
commitadb604a3879cdd7789204206d50ae2782d2538d9 (patch)
treede39c7a5039c0b956638f566ac02e715a2830783 /binutils-2.25
parent8bfb6b2bf11cfbc445239158ec28d0988f8fa947 (diff)
downloadtoolchain_binutils-adb604a3879cdd7789204206d50ae2782d2538d9.tar.gz
toolchain_binutils-adb604a3879cdd7789204206d50ae2782d2538d9.tar.bz2
toolchain_binutils-adb604a3879cdd7789204206d50ae2782d2538d9.zip
Fix darwin build failures (because of compilation warnings).
"%ld" is the printf specifier for "long int", which is 64-bit on 64-bit machines, and 32-bit on 32-bit hosts. While uint64_t is always 64 bits, so replace it with macro "PRIu64". Tested: ./build.py --host "linux" --toolchain aarch64-linux-android ./build.py --host "linux" --toolchain arm-linux-androideabi ./build.py --host "linux" --toolchain mipsel-linux-android ./build.py --host "windows" --toolchain arm-linux-androideabi Change-Id: I9f0b322ed14e6feb7a110bfebcff963cf94d7703
Diffstat (limited to 'binutils-2.25')
-rw-r--r--binutils-2.25/gold/gold.cc11
-rw-r--r--binutils-2.25/gold/layout.cc11
2 files changed, 16 insertions, 6 deletions
diff --git a/binutils-2.25/gold/gold.cc b/binutils-2.25/gold/gold.cc
index eccbc589..b278b3c3 100644
--- a/binutils-2.25/gold/gold.cc
+++ b/binutils-2.25/gold/gold.cc
@@ -25,6 +25,9 @@
#include <cstdlib>
#include <cstdio>
#include <cstring>
+// __STDC_FORMAT_MACROS is needed to turn on macros in inttypes.h.
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
#include <unistd.h>
#include <algorithm>
#include "libiberty.h"
@@ -597,9 +600,11 @@ queue_middle_tasks(const General_options& options,
// perfectly and warn. So, this is fine.
if (segment_size >= target->max_pie_data_segment_size())
{
- gold_info(_("The data segment size (%ld > %ld) is likely unsafe and"
- " PIE has been disabled for this link. See go/unsafe-pie."),
- segment_size, target->max_pie_data_segment_size());
+ gold_info(
+ _("The data segment size (%" PRIu64 " > %" PRIu64 ") is likely unsafe and"
+ " PIE has been disabled for this link. See go/unsafe-pie."),
+ segment_size,
+ target->max_pie_data_segment_size());
const_cast<General_options*>(&parameters->options())->set_pie_value(false);
}
}
diff --git a/binutils-2.25/gold/layout.cc b/binutils-2.25/gold/layout.cc
index 8b3a619a..18063a04 100644
--- a/binutils-2.25/gold/layout.cc
+++ b/binutils-2.25/gold/layout.cc
@@ -25,6 +25,9 @@
#include <cerrno>
#include <cstring>
#include <algorithm>
+// __STDC_FORMAT_MACROS is needed to turn on macros in inttypes.h.
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
#include <iostream>
#include <fstream>
#include <utility>
@@ -2815,9 +2818,11 @@ Layout::finalize(const Input_objects* input_objects, Symbol_table* symtab,
data_seg_size = rw_memsz;
if (data_seg_size >= target->max_pie_data_segment_size())
- gold_warning(_("Unsafe PIE data segment size (%ld > %ld). See "
- "go/unsafe-pie."),
- data_seg_size, target->max_pie_data_segment_size());
+ gold_warning(
+ _("Unsafe PIE data segment size (%" PRIu64 " > %" PRIu64 "). See "
+ "go/unsafe-pie."),
+ data_seg_size,
+ target->max_pie_data_segment_size());
}
// If there is a load segment that contains the file and program headers,