summaryrefslogtreecommitdiff
path: root/lto-plugin
diff options
context:
space:
mode:
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-22 10:19:22 +0000
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-22 10:19:22 +0000
commit11555a9de6b21853a2fba175c8d3eb3290950455 (patch)
tree8f8856f49d0b6f6972c3bacad6d57ed21ea67fa4 /lto-plugin
parentb5b90b5a2b71100ac888ea978e13682cac81ad57 (diff)
PR lto/50616
* lto-plugin.c (PRI_LL): New macro. (dump_symtab): Use PRI_LL instead of ll in print. (process_symtab): Use PRI_LL instead of ll in scan. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184462 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'lto-plugin')
-rw-r--r--lto-plugin/ChangeLog7
-rw-r--r--lto-plugin/lto-plugin.c12
2 files changed, 17 insertions, 2 deletions
diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog
index 5db37e791439..ad2be69f642f 100644
--- a/lto-plugin/ChangeLog
+++ b/lto-plugin/ChangeLog
@@ -1,3 +1,10 @@
+2012-02-22 Kai Tietz <ktietz@redhat.com>
+
+ PR lto/50616
+ * lto-plugin.c (PRI_LL): New macro.
+ (dump_symtab): Use PRI_LL instead of ll in print.
+ (process_symtab): Use PRI_LL instead of ll in scan.
+
2011-12-20 Andreas Schwab <schwab@linux-m68k.org>
* configure: Regenerate.
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
index d7a781368278..8d55cb8f4918 100644
--- a/lto-plugin/lto-plugin.c
+++ b/lto-plugin/lto-plugin.c
@@ -62,6 +62,14 @@ along with this program; see the file COPYING3. If not see
#include "simple-object.h"
#include "plugin-api.h"
+/* We need to use I64 instead of ll width-specifier on native Windows.
+ The reason for this is that older MS-runtimes don't support the ll. */
+#ifdef __MINGW32__
+#define PRI_LL "I64"
+#else
+#define PRI_LL "ll"
+#endif
+
/* Handle opening elf files on hosts, such as Windows, that may use
text file handling that will break binary access. */
#ifndef O_BINARY
@@ -360,7 +368,7 @@ dump_symtab (FILE *f, struct plugin_symtab *symtab)
assert (resolution != LDPR_UNKNOWN);
- fprintf (f, "%u %llx %s %s\n",
+ fprintf (f, "%u %" PRI_LL "x %s %s\n",
(unsigned int) slot, symtab->aux[j].id,
lto_resolution_str[resolution],
symtab->syms[j].name);
@@ -816,7 +824,7 @@ process_symtab (void *data, const char *name, off_t offset, off_t length)
s = strrchr (name, '.');
if (s)
- sscanf (s, ".%llx", &obj->out->id);
+ sscanf (s, ".%" PRI_LL "x", &obj->out->id);
secdata = xmalloc (length);
offset += obj->file->offset;
if (offset != lseek (obj->file->fd, offset, SEEK_SET)