aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Maddox <maddox@google.com>2007-12-13 01:50:16 +0000
committerBill Maddox <maddox@google.com>2007-12-13 01:50:16 +0000
commit5c700550a47e26572faacdebcc028d031c631d5b (patch)
treedb6296016856f4e6e0cf00d517fe8c1a9d5ae19c
parent7b958640e4b830c48439b7860c0e2a9bd4824039 (diff)
gcc/
Revert 2007-12-07 Bill Maddox <maddox@google.com> * dwarf2out.c (AT_string_form): Remove code to suppress the use of the DWARF string table. gcc/lto Revert 2007-12-07 Bill Maddox <maddox@google.com> * lto.c (lto_str_fd_init): New function. (lto_str_fd_close): New function. (lto_file_init): Call lto_str_fd_init. (lto_file_close): Call lto_str_fd_close. (lto_str_read): New function. Read debug string table. (lto_str_lookup): New function. Get string for debug string table offset. (lto_read_form): Recognize DW_FORM_strp. (lto_file_read): Invoke lto_str_read. * lto-elf.c (lto_elf_file_open): Read raw section data for the .debug_str section, if present. * lto.h (struct lto_str_fd_struct): New struct. (struct lto_file_struct): Added new field DEBUG_STR to hold the file descriptor for the debug string table. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/lto@130804 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ChangeLog.lto13
-rw-r--r--gcc/dwarf2out.c5
-rw-r--r--gcc/lto/ChangeLog24
-rw-r--r--gcc/lto/lto-elf.c12
-rw-r--r--gcc/lto/lto.c58
-rw-r--r--gcc/lto/lto.h16
7 files changed, 48 insertions, 85 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 04b606b62aa..c88d351a112 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,8 +1,3 @@
-2007-12-07 Bill Maddox <maddox@google.com>
-
- * dwarf2out.c (AT_string_form): Remove code to suppress
- the use of the DWARF string table.
-
2007-11-13 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/34063
diff --git a/gcc/ChangeLog.lto b/gcc/ChangeLog.lto
index 95183839942..47b231746a5 100644
--- a/gcc/ChangeLog.lto
+++ b/gcc/ChangeLog.lto
@@ -1,3 +1,16 @@
+2007-12-12 Bill Maddox <maddox@google.com>
+
+ Revert
+ 2007-12-07 Bill Maddox <maddox@google.com>
+
+ * dwarf2out.c (AT_string_form): Remove code to suppress
+ the use of the DWARF string table.
+
+2007-12-07 Bill Maddox <maddox@google.com>
+
+ * dwarf2out.c (AT_string_form): Remove code to suppress
+ the use of the DWARF string table.
+
2007-12-07 Nathan Froyd <froydnj@codesourcery.com>
* tree-flow.h (init_empty_tree_cfg_for_function): Declare.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 040b7b88cc8..12d50ce8246 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -5144,6 +5144,11 @@ AT_string_form (dw_attr_ref a)
if (node->form)
return node->form;
+ /* FIXME!!! This is a temp hack to not use the string table because
+ the current lto code does not do this yet. */
+ if (flag_generate_lto)
+ return node->form = DW_FORM_string;
+
len = strlen (node->str) + 1;
/* If the string is shorter or equal to the size of the reference, it is
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index f9f78739c13..26d386eae6a 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,4 +1,7 @@
-2007-12-07 Bill Maddox <maddox@google.com>
+2007-12-12 Bill Maddox <maddox@google.com>
+
+ Revert
+ 2007-12-07 Bill Maddox <maddox@google.com>
* lto.c (lto_str_fd_init): New function.
(lto_str_fd_close): New function.
@@ -17,6 +20,25 @@
(struct lto_file_struct): Added new field DEBUG_STR
to hold the file descriptor for the debug string table.
+2007-12-07 Bill Maddox <maddox@google.com>
+
+ * lto.c (lto_str_fd_init): New function.
+ (lto_str_fd_close): New function.
+ (lto_file_init): Call lto_str_fd_init.
+ (lto_file_close): Call lto_str_fd_close.
+ (lto_str_read): New function. Read debug string table.
+ (lto_str_lookup): New function. Get string for debug
+ string table offset.
+ (lto_read_form): Recognize DW_FORM_strp.
+ (lto_file_read): Invoke lto_str_read.
+
+ * lto-elf.c (lto_elf_file_open): Read raw section data
+ for the .debug_str section, if present.
+
+ * lto.h (struct lto_str_fd_struct): New struct.
+ (struct lto_file_struct): Added new field DEBUG_STR
+ to hold the file descriptor for the debug string table.
+
2007-12-07 Nathan Froyd <froydnj@codesourcery.com>
* lto-read.c (input_cfg): Call init_empty_tree_cfg_for_function.
diff --git a/gcc/lto/lto-elf.c b/gcc/lto/lto-elf.c
index 8e43721a6f7..5a522128f09 100644
--- a/gcc/lto/lto-elf.c
+++ b/gcc/lto/lto-elf.c
@@ -387,7 +387,7 @@ lto_elf_file_open (const char *filename)
goto fail;
}
- /* Find the .debug_info, .debug_abbrev, and .debug_str sections. */
+ /* Find the .debug_info and .debug_abbrev sections. */
data = lto_elf_find_section_data (elf_file, ".debug_info");
if (!data)
{
@@ -410,16 +410,6 @@ lto_elf_file_open (const char *filename)
fd->start = (const char *) data->d_buf;
fd->end = fd->start + data->d_size;
- /* The string table may not be present if no references
- were made to it. */
- data = lto_elf_find_section_data (elf_file, ".debug_str");
- if (data)
- {
- fd = (lto_fd *) &result->debug_str;
- fd->start = (const char *) data->d_buf;
- fd->end = fd->start + data->d_size;
- }
-
/* Read the ELF symbol table. */
lto_elf_read_symtab (elf_file);
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 8183d5f6c26..a8893b79176 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -210,16 +210,6 @@ lto_abbrev_fd_init (lto_abbrev_fd *fd, const char *name, lto_file *file)
fd->abbrevs = NULL;
}
-/* Initialize FD, a newly allocated file descriptor for a DWARF2
- string table section. NAME and FILE are as for lto_fd_init. */
-static void
-lto_str_fd_init (lto_str_fd *fd, const char *name, lto_file *file)
-{
- lto_fd_init ((lto_fd *) fd, name, file);
- fd->strings_size = 0;
- fd->strings = NULL;
-}
-
/* Close FD. */
static void
lto_info_fd_close (lto_info_fd *fd)
@@ -247,14 +237,6 @@ lto_abbrev_fd_close (lto_abbrev_fd *fd)
XDELETEVEC (fd->abbrevs);
}
-/* Close FD. */
-static void
-lto_str_fd_close (lto_str_fd *fd ATTRIBUTE_UNUSED)
-{
- /* Nothing to do. We do not own the FD->STRINGS array,
- and must not free it here. */
-}
-
/* Initialize FILE, an LTO file object for FILENAME. */
void
lto_file_init (lto_file *file,
@@ -265,7 +247,6 @@ lto_file_init (lto_file *file,
file->filename = filename;
lto_info_fd_init (&file->debug_info, ".debug_info", file);
lto_abbrev_fd_init (&file->debug_abbrev, ".debug_abbrev", file);
- lto_str_fd_init (&file->debug_str, ".debug_str", file);
}
/* Close FILE. */
@@ -274,7 +255,6 @@ lto_file_close (lto_file *file)
{
lto_info_fd_close (&file->debug_info);
lto_abbrev_fd_close (&file->debug_abbrev);
- lto_str_fd_close (&file->debug_str);
ggc_free (file);
}
@@ -577,31 +557,6 @@ lto_abbrev_lookup (lto_abbrev_fd *abbrev_fd, uint64_t abbrev)
return result;
}
-/* Read the DWARF2 string table from STR_FD, placing it in
- STR_FD->STRINGS. There is almost nothing to do here, as
- the raw section contents are used without modification. */
-static void
-lto_str_read (lto_str_fd *str_fd)
-{
- /* We should only read the string table once. */
- gcc_assert (!str_fd->strings);
- /* START and END may be NULL if the string table is not present. */
- str_fd->strings = str_fd->base.start;
- str_fd->strings_size = str_fd->base.end - str_fd->base.start;
- /* The string table must be zero-terminated if non-empty. */
- if (str_fd->strings_size != 0 && *(str_fd->base.end - 1) != '\0')
- lto_file_corrupt_error ((lto_fd *)str_fd);
-}
-
-/* Return the string table entry with offset OFFSET. */
-static const char *
-lto_str_lookup (lto_str_fd *str_fd, uint64_t offset)
-{
- if (offset >= str_fd->strings_size)
- lto_file_corrupt_error ((lto_fd *)str_fd);
- return str_fd->strings + offset;
-}
-
/* Read a section offset from FD. In 32-bit DWARF, this is a 32-bit
value; in 64-bit DWARF, it is a 64-bit value. Therefore, the value
returned is always a 64-bit value. */
@@ -874,11 +829,12 @@ lto_read_form (lto_info_fd *info_fd,
break;
case DW_FORM_strp:
- {
- uint64_t offset = fd->dwarf64 ? lto_read_udword (fd) : lto_read_uword (fd);
- out->cl = DW_cl_string;
- out->u.string = lto_str_lookup (&info_fd->base.file->debug_str, offset);
- }
+ /* Temporary hack: we don't need the string data, but we do need
+ it not to crash if it sees one. So just skip past the offset
+ and return an empty string. */
+ out->cl = DW_cl_string;
+ fd->dwarf64 ? lto_read_uword (fd) : lto_read_udword (fd);
+ out->u.string = "";
break;
case DW_FORM_data1:
@@ -3463,8 +3419,6 @@ lto_file_read (lto_file *file)
/* The descriptor for the .debug_info section. */
lto_fd *fd;
- /* Read the string table. */
- lto_str_read (&file->debug_str);
/* Read the abbreviation entries. */
lto_abbrev_read (&file->debug_abbrev);
/* Read the compilation units. */
diff --git a/gcc/lto/lto.h b/gcc/lto/lto.h
index 3238340b1e1..4863b33591f 100644
--- a/gcc/lto/lto.h
+++ b/gcc/lto/lto.h
@@ -144,18 +144,6 @@ typedef struct lto_abbrev_fd_struct GTY(())
}
lto_abbrev_fd;
-/* A file descriptor for reading from a DWARF string table section. */
-typedef struct lto_str_fd_struct GTY(())
-{
- /* The base object. */
- lto_fd base;
- /* The size of the strings vector. */
- size_t strings_size;
- /* The strings, zero-terminated and possibly sharing tails. */
- const char * GTY((length ("%h.strings_size"), skip)) strings;
-}
-lto_str_fd;
-
/* The virtual function table for an lto_file. */
typedef struct lto_file_vtable_struct GTY(())
{
@@ -187,10 +175,6 @@ typedef struct lto_file_struct GTY(())
lto_info_fd debug_info;
/* The contents of the .debug_abbrev section. */
lto_abbrev_fd debug_abbrev;
- /* The contents of the .debug_str section.
- This section need not be present, in which case
- we treat it as if it were present but empty. */
- lto_str_fd debug_str;
}
lto_file;