]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2010-05-24 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 May 2010 12:27:30 +0000 (12:27 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 May 2010 12:27:30 +0000 (12:27 +0000)
* lto-elf.c (lto_obj_build_section_table): Work around
FreeBSD libelf issue.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159777 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/lto/ChangeLog
gcc/lto/lto-elf.c

index 83cfe3e3e90d65748c0c9806adbb66cafa873741..766c71b85fea2f53bf558a16f5719bbfad5edd57 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-24  Richard Guenther  <rguenther@suse.de>
+
+       * lto-elf.c (lto_obj_build_section_table): Work around
+       FreeBSD libelf issue.
+
 2010-05-22  Richard Guenther  <rguenther@suse.de>
 
        * lto.c (read_cgraph_and_symbols): Do not collect.
index 1796888f4c31fc3bff5791a4144d3405a283206c..bb4df809d9e1990161f42f7134bab54c9984fee0 100644 (file)
@@ -189,6 +189,13 @@ lto_obj_build_section_table (lto_file *lto_file)
   section_hash_table = htab_create (37, hash_name, eq_name, free);
 
   base_offset = elf_getbase (elf_file->elf);
+  /* We are reasonably sure that elf_getbase does not fail at this
+     point.  So assume that we run into the incompatibility with
+     the FreeBSD libelf implementation that has a non-working
+     elf_getbase for non-archive members in which case the offset
+     should be zero.  */
+  if (base_offset == (size_t)-1)
+    base_offset = 0;
   for (section = elf_getscn (elf_file->elf, 0);
        section;
        section = elf_nextscn (elf_file->elf, section))