aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-10-09 13:24:59 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-10-09 13:24:59 +0000
commitb1b07c92e166e6c5d8f0fd95503e44b4ecfbd762 (patch)
treedf79584a59c59cc699aebb0953c8a12388d08091 /gcc/lto
parent9f3f7d131fd4200ed84aa44ec75b3c675b8273ae (diff)
downloadgcc-b1b07c92e166e6c5d8f0fd95503e44b4ecfbd762.zip
gcc-b1b07c92e166e6c5d8f0fd95503e44b4ecfbd762.tar.gz
gcc-b1b07c92e166e6c5d8f0fd95503e44b4ecfbd762.tar.bz2
re PR driver/41637 (testsuite (-flto/-fwhopr) leaves does not clean up in /tmp)
2009-10-09 Richard Guenther <rguenther@suse.de> PR driver/41637 * lto-wrapper.c (ltrans_output_file, flto_out, args_name): New globals. (lto_wrapper_exit): New function. (fatal): Use it. (fatal_perror): Likewise. (fork_execute): Use global args_name, do not free it. (run_gcc): Use global ltrans_output_file, flto_out, do not free them. * lto-streamer.h: Remove duplicate prototypes. PR lto/41635 PR lto/41636 lto/ * lto.c (read_cgraph_and_symbols): Do not assert we can open a file. * lto-elf.c (init_shdr##BITS): Fix i18n problems. (init_ehdr##BITS): Likewise. From-SVN: r152588
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog9
-rw-r--r--gcc/lto/lto-elf.c14
-rw-r--r--gcc/lto/lto.c5
3 files changed, 25 insertions, 3 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index f2eb1a2..82b8bec 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,12 @@
+2009-10-09 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41635
+ PR lto/41636
+ * lto.c (read_cgraph_and_symbols): Do not assert we can open
+ a file.
+ * lto-elf.c (init_shdr##BITS): Fix i18n problems.
+ (init_ehdr##BITS): Likewise.
+
2009-10-08 Joseph Myers <joseph@codesourcery.com>
* lto-elf.c (init_shdr##BITS, lto_elf_begin_section_with_type,
diff --git a/gcc/lto/lto-elf.c b/gcc/lto/lto-elf.c
index 28c26c7..190430b 100644
--- a/gcc/lto/lto-elf.c
+++ b/gcc/lto/lto-elf.c
@@ -235,7 +235,12 @@ init_shdr##BITS (Elf_Scn *scn, size_t sh_name, size_t sh_type) \
\
shdr = elf##BITS##_getshdr (scn); \
if (!shdr) \
- fatal_error ("elf"#BITS"_getshdr() failed: %s", elf_errmsg (-1));\
+ { \
+ if (BITS == 32) \
+ fatal_error ("elf32_getshdr() failed: %s", elf_errmsg (-1)); \
+ else \
+ fatal_error ("elf64_getshdr() failed: %s", elf_errmsg (-1)); \
+ } \
\
shdr->sh_name = sh_name; \
shdr->sh_type = sh_type; \
@@ -486,7 +491,12 @@ init_ehdr##BITS (lto_elf_file *elf_file) \
\
ehdr = elf##BITS##_newehdr (elf_file->elf); \
if (!ehdr) \
- fatal_error ("elf"#BITS"_newehdr() failed: %s", elf_errmsg (-1));\
+ { \
+ if (BITS == 32) \
+ fatal_error ("elf32_newehdr() failed: %s", elf_errmsg (-1)); \
+ else \
+ fatal_error ("elf64_newehdr() failed: %s", elf_errmsg (-1)); \
+ } \
\
memcpy (ehdr->e_ident, cached_file_attrs.elf_ident, \
sizeof cached_file_attrs.elf_ident); \
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index cc40091..2b674c1 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -1779,7 +1779,10 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
unsigned num_objects;
resolution = fopen (resolution_file_name, "r");
- gcc_assert (resolution != NULL);
+ if (resolution == NULL)
+ fatal_error ("could not open symbol resolution file: %s",
+ xstrerror (errno));
+
t = fscanf (resolution, "%u", &num_objects);
gcc_assert (t == 1);