aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2010-04-16 13:45:25 +0000
committerRainer Orth <ro@gcc.gnu.org>2010-04-16 13:45:25 +0000
commit8ccb78f2d06ac9c06f49b8bdf1527bd7ebeadf06 (patch)
treed9a473d88d703aacdf7e3191ba2b717abcb59e6d /gcc/lto
parentbc9c331d4320ff1e3b8258fcaf87f45bf3c4f2bf (diff)
downloadgcc-8ccb78f2d06ac9c06f49b8bdf1527bd7ebeadf06.zip
gcc-8ccb78f2d06ac9c06f49b8bdf1527bd7ebeadf06.tar.gz
gcc-8ccb78f2d06ac9c06f49b8bdf1527bd7ebeadf06.tar.bz2
configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx separately.
toplevel: * configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx separately. * configure: Regenerate. gcc: * configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx flavor. * configure: Regenerate. * config.in: Regenerate. * doc/install.texi (Prerequisites): Document that Solaris 2 libelf works. gcc/lto: * lto-elf.c [!HAVE_ELF_GETSHDRSTRNDX] (elf_getshdrstrndx): New function. From-SVN: r158423
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog5
-rw-r--r--gcc/lto/lto-elf.c16
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index c92562f..20b89d6 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * lto-elf.c [!HAVE_ELF_GETSHDRSTRNDX] (elf_getshdrstrndx): New
+ function.
+
2010-03-09 Eric Botcazou <ebotcazou@adacore.com>
PR bootstrap/43276
diff --git a/gcc/lto/lto-elf.c b/gcc/lto/lto-elf.c
index 59f7150..c777da7 100644
--- a/gcc/lto/lto-elf.c
+++ b/gcc/lto/lto-elf.c
@@ -455,6 +455,22 @@ DEFINE_VALIDATE_EHDR (32)
DEFINE_VALIDATE_EHDR (64)
+#ifndef HAVE_ELF_GETSHDRSTRNDX
+/* elf_getshdrstrndx replacement for systems that lack it, but provide
+ either the gABI conformant or Solaris 2 variant of elf_getshstrndx
+ instead. */
+
+static int
+elf_getshdrstrndx (Elf *elf, size_t *dst)
+{
+#ifdef HAVE_ELF_GETSHSTRNDX_GABI
+ return elf_getshstrndx (elf, dst);
+#else
+ return elf_getshstrndx (elf, dst) ? 0 : -1;
+#endif
+}
+#endif
+
/* Validate's ELF_FILE's executable header and, if cached_file_attrs is
uninitialized, caches the results. Also records the section header string
table's section index. Returns true on success or false on failure. */