aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2008-01-28 19:53:49 +0000
committerNathan Froyd <froydnj@codesourcery.com>2008-01-28 19:53:49 +0000
commitda35ba20c7582d2c8d73f99f98198879cb5f3d6a (patch)
tree012f83290ef4d9bc5d2ad553206108526b7b7198
parent1644647a66394a497432d002ab7d644455e81634 (diff)
* lto-elf.c (lto_elf_read_var_init): Remove unused function.
(lto_elf_build_init): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/lto@131917 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/lto/ChangeLog5
-rw-r--r--gcc/lto/lto-elf.c117
2 files changed, 5 insertions, 117 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 957ce09bd8e..17412bae992 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-28 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-elf.c (lto_elf_read_var_init): Remove unused function.
+ (lto_elf_build_init): Likewise.
+
2008-01-14 Kenneth Zadeck <zadeck@naturalbridge.com>
* lto-read.c: Renamed to lto-function-in.c.
diff --git a/gcc/lto/lto-elf.c b/gcc/lto/lto-elf.c
index 5a522128f09..78ce4469a95 100644
--- a/gcc/lto/lto-elf.c
+++ b/gcc/lto/lto-elf.c
@@ -455,120 +455,3 @@ lto_elf_unmap_fn_body (lto_file *file ATTRIBUTE_UNUSED,
{
return;
}
-
-/* Build an initializer of the indicated TYPE from the DATA stored in
- the object file. */
-static tree
-lto_elf_build_init (lto_elf_file *elf_file ATTRIBUTE_UNUSED,
- tree type,
- const uint8_t *data)
-{
- tree init;
-
- init = error_mark_node;
- if (AGGREGATE_TYPE_P (type))
- sorry ("initializers for aggregate types");
- else if (TREE_CODE (type) == COMPLEX_TYPE)
- sorry ("initializers for complex types");
- else if (INTEGRAL_TYPE_P (type))
- {
- unsigned HOST_WIDE_INT low;
- unsigned HOST_WIDE_INT high;
- HOST_WIDE_INT size;
- int i;
-
- low = 0;
- high = 0;
- size = int_size_in_bytes (type);
- gcc_assert (size != -1);
- if ((size_t) size > sizeof (low))
- sorry ("multi-word integral initializers");
- /* Read the initializer, swapping bytes if necessary. */
- for (i = 0; i < size; ++i)
- {
- uint8_t byte;
- byte = *data++;
- if (!BYTES_BIG_ENDIAN)
- low |= byte << (HOST_BITS_PER_CHAR * i);
- else
- low |= byte << (HOST_BITS_PER_CHAR * (size - 1 - i));
- }
- /* Create the INTEGER_CST. */
- init = build_int_cst_wide_type (type, low, high);
- }
- else
- sorry ("initializers for other types");
-
- return init;
-}
-
-/* Read the initializer for VAR from FILE, reconsitituing it from the
- initializer and relocation information in the object file. This
- function is not presently used; instead we are reading in
- serialized trees. If this function remains unused, it should be
- removed before mering LTO into mainline. */
-static void
-lto_elf_read_var_init (lto_file *file,
- tree var)
-{
- lto_elf_file *elf_file;
- const char *name;
- Elf64_Sym *sym;
-
- elf_file = (lto_elf_file *) file;
- /* Find the ELF symbol table entry for VAR. */
- name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (var));
- sym = lto_elf_lookup_sym (elf_file, name);
- /* This is an initialized variable so it must be present in the ELF
- file. */
- if (!sym)
- fatal_error ("ELF symbol table does not contain %qs", name);
- /* A VAR_DECL should always be an STT_OBJECT symbol. */
- if (ELF64_ST_TYPE (sym->st_info) != STT_OBJECT)
- fatal_error ("ELF symbol for variable %qs is not %qs",
- name, "STT_OBJECT");
- switch (sym->st_shndx)
- {
- case SHN_ABS:
- /* The input is a relocatable object so the symbol should not
- have an absolute address. */
- fatal_error ("ELF symbol for defined variable %qs is %qs",
- name, "SHN_ABS");
- break;
- case SHN_UNDEF:
- /* This function is only called for variables with initializers
- which must, therefore, be defined. */
- fatal_error ("ELF symbol for defined variable %qs is %qs",
- name, "SHN_UNDEF");
- break;
- case SHN_COMMON:
- /* The symbol is zero-initialized. We do not need to explicitly
- represent the initializer. */
- break;
- case SHN_XINDEX:
- sorry ("support for SHN_XINDEX");
- break;
- default:
- {
- Elf_Scn *section;
- uint64_t offset;
- Elf_Data *data;
- tree init;
-
- /* The location of the data is given as a section-relative
- offset. */
- section = elf_getscn (elf_file->elf, sym->st_shndx);
- offset = (uint64_t) sym->st_value;
- data = elf_rawdata (section, NULL);
- init = lto_elf_build_init (elf_file,
- TREE_TYPE (var),
- (uint8_t *) data->d_buf + offset);
- DECL_INITIAL (var) = init;
- }
- break;
- }
- /* We're now done with the symbol. */
- lto_elf_free_sym (elf_file, sym);
-
- return;
-}