This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] Update call to elf_getshstrndx
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc-patches at gcc dot gnu dot org, Richard Guenther <rguenther at suse dot de>
- Date: Fri, 4 Sep 2009 10:33:22 -0400
- Subject: [lto] Update call to elf_getshstrndx
Newer versions of libelf have deprecated the function elf_getshstrndx
in favour of elf_getshdrstrndx (would it kill them to use more
vowels?).
This was causing build failures on fedora 11, and it requires
upgrading to libelf-0.8.12. I've updated the wiki documentation.
Ideally, we'd have a test so the old function can be used if there is
an older libelf installed. But I have not implemented that yet (Sorry
richi, you'll have to upgrade to 0.8.12 for now).
Tested on x86_64. Applied to branch.
Diego.
2009-09-03 Diego Novillo <dnovillo@google.com>
* lto-elf.c (validate_file): Replace call to
elf_getshstrndx with call to elf_getshdrstrndx.
Index: branches/lto/gcc/lto/lto-elf.c
===================================================================
--- branches/lto/gcc/lto/lto-elf.c (revision 151421)
+++ branches/lto/gcc/lto/lto-elf.c (revision 151422)
@@ -450,7 +450,7 @@ validate_file (lto_elf_file *elf_file)
}
/* Read the string table used for section header names. */
- if (elf_getshstrndx (elf_file->elf, &elf_file->sec_strtab) == -1)
+ if (elf_getshdrstrndx (elf_file->elf, &elf_file->sec_strtab) == -1)
{
error ("could not locate ELF string table: %s", elf_errmsg (0));
return false;