(lto_obj_file_open): ... to this.
(lto_elf_file_close): Likewise ...
(lto_obj_file_close): ... and likewise.
(lto_elf_build_section_table): Likewise ...
(lto_obj_build_section_table): ... and likewise.
(lto_elf_begin_section): Likewise ...
(lto_obj_begin_section): ... and likewise.
(lto_elf_append_data): Likewise ...
(lto_obj_append_data): ... and likewise.
(lto_elf_end_section): Likewise ...
(lto_obj_end_section): ... and likewise.
* lto.c (lto_file_read): Update references to the above.
(lto_wpa_write_files): Likewise.
(lto_read_all_file_options): Likewise.
(read_cgraph_and_symbols): Likewise.
* lto-lang.c (LANG_HOOKS_BEGIN_SECTION): Likewise.
(LANG_HOOKS_APPEND_DATA): Likewise.
(LANG_HOOKS_END_SECTION): Likewise.
* lto-elf.c (lto_elf_file_open): Rename from this ...
(lto_obj_file_open): ... to this, updating any references.
(lto_elf_file_close): Likewise ...
(lto_obj_file_close): ... and likewise.
(lto_elf_build_section_table): Likewise ...
(lto_obj_build_section_table): ... and likewise.
(lto_elf_begin_section): Likewise ...
(lto_obj_begin_section): ... and likewise.
(lto_elf_append_data): Likewise ...
(lto_obj_append_data): ... and likewise.
(lto_elf_end_section): Likewise ...
(lto_obj_end_section): ... and likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158718
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-04-26 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ * lto.h (lto_elf_file_open): Rename prototype from this ...
+ (lto_obj_file_open): ... to this.
+ (lto_elf_file_close): Likewise ...
+ (lto_obj_file_close): ... and likewise.
+ (lto_elf_build_section_table): Likewise ...
+ (lto_obj_build_section_table): ... and likewise.
+ (lto_elf_begin_section): Likewise ...
+ (lto_obj_begin_section): ... and likewise.
+ (lto_elf_append_data): Likewise ...
+ (lto_obj_append_data): ... and likewise.
+ (lto_elf_end_section): Likewise ...
+ (lto_obj_end_section): ... and likewise.
+ * lto.c (lto_file_read): Update references to the above.
+ (lto_wpa_write_files): Likewise.
+ (lto_read_all_file_options): Likewise.
+ (read_cgraph_and_symbols): Likewise.
+ * lto-lang.c (LANG_HOOKS_BEGIN_SECTION): Likewise.
+ (LANG_HOOKS_APPEND_DATA): Likewise.
+ (LANG_HOOKS_END_SECTION): Likewise.
+ * lto-elf.c (lto_elf_file_open): Rename from this ...
+ (lto_obj_file_open): ... to this, updating any references.
+ (lto_elf_file_close): Likewise ...
+ (lto_obj_file_close): ... and likewise.
+ (lto_elf_build_section_table): Likewise ...
+ (lto_obj_build_section_table): ... and likewise.
+ (lto_elf_begin_section): Likewise ...
+ (lto_obj_begin_section): ... and likewise.
+ (lto_elf_append_data): Likewise ...
+ (lto_obj_append_data): ... and likewise.
+ (lto_elf_end_section): Likewise ...
+ (lto_obj_end_section): ... and likewise.
+
2010-04-21 Jan Hubicka <jh@suse.cz>
* lto.c (lto_fixup_tree): Do not call wpa fixup.
the start and size of each section in the .o file. */
htab_t
-lto_elf_build_section_table (lto_file *lto_file)
+lto_obj_build_section_table (lto_file *lto_file)
{
lto_elf_file *elf_file = (lto_elf_file *)lto_file;
htab_t section_hash_table;
/* Begin a new ELF section named NAME in the current output file. */
void
-lto_elf_begin_section (const char *name)
+lto_obj_begin_section (const char *name)
{
lto_elf_begin_section_with_type (name, SHT_PROGBITS);
}
been written. */
void
-lto_elf_append_data (const void *data, size_t len, void *block)
+lto_obj_append_data (const void *data, size_t len, void *block)
{
lto_elf_file *file;
Elf_Data *elf_data;
and sets the current output file's scn member to NULL. */
void
-lto_elf_end_section (void)
+lto_obj_end_section (void)
{
lto_elf_file *file;
Returns the opened file. */
lto_file *
-lto_elf_file_open (const char *filename, bool writable)
+lto_obj_file_open (const char *filename, bool writable)
{
lto_elf_file *elf_file;
lto_file *result = NULL;
fail:
if (result)
- lto_elf_file_close (result);
+ lto_obj_file_close (result);
return NULL;
}
any cached data buffers are freed. */
void
-lto_elf_file_close (lto_file *file)
+lto_obj_file_close (lto_file *file)
{
lto_elf_file *elf_file = (lto_elf_file *) file;
struct lto_char_ptr_base *cur, *tmp;
if (gelf_update_ehdr (elf_file->elf, ehdr_p) == 0)
fatal_error ("gelf_update_ehdr() failed: %s", elf_errmsg (-1));
lto_write_stream (elf_file->shstrtab_stream);
- lto_elf_end_section ();
+ lto_obj_end_section ();
lto_set_current_out_file (old_file);
free (elf_file->shstrtab_stream);
#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE lto_format_attribute_table
#undef LANG_HOOKS_BEGIN_SECTION
-#define LANG_HOOKS_BEGIN_SECTION lto_elf_begin_section
+#define LANG_HOOKS_BEGIN_SECTION lto_obj_begin_section
#undef LANG_HOOKS_APPEND_DATA
-#define LANG_HOOKS_APPEND_DATA lto_elf_append_data
+#define LANG_HOOKS_APPEND_DATA lto_obj_append_data
#undef LANG_HOOKS_END_SECTION
-#define LANG_HOOKS_END_SECTION lto_elf_end_section
+#define LANG_HOOKS_END_SECTION lto_obj_end_section
#undef LANG_HOOKS_INIT_TS
#define LANG_HOOKS_INIT_TS lto_init_ts
file_data = XCNEW (struct lto_file_decl_data);
file_data->file_name = file->filename;
- file_data->section_hash_table = lto_elf_build_section_table (file);
+ file_data->section_hash_table = lto_obj_build_section_table (file);
file_data->renaming_hash_table = lto_create_renaming_table ();
data = lto_get_section_data (file_data, LTO_section_decls, NULL, &len);
if (cgraph_node_set_needs_ltrans_p (set))
{
/* Write all the nodes in SET to TEMP_FILENAME. */
- file = lto_elf_file_open (temp_filename, true);
+ file = lto_obj_file_open (temp_filename, true);
if (!file)
- fatal_error ("lto_elf_file_open() failed");
+ fatal_error ("lto_obj_file_open() failed");
lto_set_current_out_file (file);
ipa_write_optimization_summaries (set);
lto_set_current_out_file (NULL);
- lto_elf_file_close (file);
+ lto_obj_file_close (file);
}
}
for (i = 0; i < num_in_fnames; i++)
{
struct lto_file_decl_data *file_data;
- lto_file *file = lto_elf_file_open (in_fnames[i], false);
+ lto_file *file = lto_obj_file_open (in_fnames[i], false);
if (!file)
break;
file_data = XCNEW (struct lto_file_decl_data);
file_data->file_name = file->filename;
- file_data->section_hash_table = lto_elf_build_section_table (file);
+ file_data->section_hash_table = lto_obj_build_section_table (file);
lto_read_file_options (file_data);
- lto_elf_file_close (file);
+ lto_obj_file_close (file);
htab_delete (file_data->section_hash_table);
free (file_data);
}
fflush (stderr);
}
- current_lto_file = lto_elf_file_open (fnames[i], false);
+ current_lto_file = lto_obj_file_open (fnames[i], false);
if (!current_lto_file)
break;
all_file_decl_data[last_file_ix++] = file_data;
- lto_elf_file_close (current_lto_file);
+ lto_obj_file_close (current_lto_file);
current_lto_file = NULL;
}
extern void lto_main (int);
extern void lto_read_all_file_options (void);
-/* In lto-elf.c */
-extern lto_file *lto_elf_file_open (const char *filename, bool writable);
-extern void lto_elf_file_close (lto_file *file);
-extern htab_t lto_elf_build_section_table (lto_file *file);
-extern void lto_elf_begin_section (const char *name);
-extern void lto_elf_append_data (const void *data, size_t len, void *block);
-extern void lto_elf_end_section (void);
+/* In lto-elf.c or lto-coff.c */
+extern lto_file *lto_obj_file_open (const char *filename, bool writable);
+extern void lto_obj_file_close (lto_file *file);
+extern htab_t lto_obj_build_section_table (lto_file *file);
+extern void lto_obj_begin_section (const char *name);
+extern void lto_obj_append_data (const void *data, size_t len, void *block);
+extern void lto_obj_end_section (void);
extern lto_file *lto_set_current_out_file (lto_file *file);
extern lto_file *lto_get_current_out_file (void);