summaryrefslogtreecommitdiff
path: root/lto-plugin
diff options
context:
space:
mode:
authorYvan Roux <yvan.roux@linaro.org>2017-08-17 08:47:40 +0200
committerYvan Roux <yvan.roux@linaro.org>2017-08-17 08:47:40 +0200
commitddc8f6a772b5c0be5767de6c13d51fed2ff2b4bd (patch)
treed83f226e5c158395a319d285cab7417b33c5d11a /lto-plugin
parentd16cc92b9de59611269a89dc9f18161313b1238c (diff)
downloadgcc-ddc8f6a772b5c0be5767de6c13d51fed2ff2b4bd.tar.gz
Merge branches/gcc-7-branch rev 251138.
Change-Id: I97fe02630ee0e0dac705ef3ef3bf76ddafd5cab8
Diffstat (limited to 'lto-plugin')
-rw-r--r--lto-plugin/ChangeLog13
-rw-r--r--lto-plugin/lto-plugin.c13
2 files changed, 19 insertions, 7 deletions
diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog
index 9f3c1a27f88..829a81352b0 100644
--- a/lto-plugin/ChangeLog
+++ b/lto-plugin/ChangeLog
@@ -1,3 +1,16 @@
+2017-08-14 Release Manager
+
+ * GCC 7.2.0 released.
+
+2017-07-26 Georg-Johann Lay <avr@gjlay.de>
+
+ Backport from 2017-07-21 trunk r250428.
+
+ PR lto/81487
+ * lto-plugin.c (claim_file_handler): Use xasprintf instead of
+ asprintf.
+ [hi!=0]: Swap hi and lo arguments supplied to xasprintf.
+
2017-05-02 Release Manager
* GCC 7.1.0 released.
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
index f713c5dab0d..27fcfbeca09 100644
--- a/lto-plugin/lto-plugin.c
+++ b/lto-plugin/lto-plugin.c
@@ -975,17 +975,16 @@ claim_file_handler (const struct ld_plugin_input_file *file, int *claimed)
if (file->offset != 0)
{
- char *objname;
/* We pass the offset of the actual file, not the archive header.
Can't use PRIx64, because that's C99, so we have to print the
- 64-bit hex int as two 32-bit ones. */
- int lo, hi, t;
+ 64-bit hex int as two 32-bit ones. Use xasprintf instead of
+ asprintf because asprintf doesn't work as expected on some older
+ mingw32 hosts. */
+ int lo, hi;
lo = file->offset & 0xffffffff;
hi = ((int64_t)file->offset >> 32) & 0xffffffff;
- t = hi ? asprintf (&objname, "%s@0x%x%08x", file->name, lo, hi)
- : asprintf (&objname, "%s@0x%x", file->name, lo);
- check (t >= 0, LDPL_FATAL, "asprintf failed");
- lto_file.name = objname;
+ lto_file.name = hi ? xasprintf ("%s@0x%x%08x", file->name, hi, lo)
+ : xasprintf ("%s@0x%x", file->name, lo);
}
else
{