aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-12-19 13:23:40 -0800
committerDavid S. Miller <davem@davemloft.net>2014-12-19 13:45:28 -0800
commit6d4188dd7fe4fd7b9aeac91eab4e3c259538106d (patch)
tree141fe50e126ce2efb6cf239cdbe4add47aa79841
parent804c54f7b0d37d7d3c673724842135b220ba9c1c (diff)
downloadglibc-6d4188dd7fe4fd7b9aeac91eab4e3c259538106d.zip
glibc-6d4188dd7fe4fd7b9aeac91eab4e3c259538106d.tar.gz
glibc-6d4188dd7fe4fd7b9aeac91eab4e3c259538106d.tar.bz2
Fix array bounds warnings in elf_get_dyanmic_info() on sparc with gcc-4.6
* get-dynamic-info.h (elf_get_dynamic_info): Ignore -Warray-bounds for a link_map->l_info array access.
-rw-r--r--ChangeLog5
-rw-r--r--elf/get-dynamic-info.h11
2 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6bd8a38..a5f2888 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-19 David S. Miller <davem@davemloft.net>
+
+ * get-dynamic-info.h (elf_get_dynamic_info): Ignore -Warray-bounds for a
+ link_map->l_info array access.
+
2014-12-19 Chris Metcalf <cmetcalf@ezchip.com>
* iconvdata/tst-loading.c (TIMEOUT): Increase timeout 10 sec.
diff --git a/elf/get-dynamic-info.h b/elf/get-dynamic-info.h
index 20ccf30..3f12e2e 100644
--- a/elf/get-dynamic-info.h
+++ b/elf/get-dynamic-info.h
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <assert.h>
+#include <libc-internal.h>
#ifndef RESOLVE_MAP
static
@@ -47,7 +48,15 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
info[dyn->d_tag] = dyn;
else if (dyn->d_tag >= DT_LOPROC &&
dyn->d_tag < DT_LOPROC + DT_THISPROCNUM)
- info[dyn->d_tag - DT_LOPROC + DT_NUM] = dyn;
+ {
+ /* This does not violate the array bounds of l->l_info, but
+ gcc 4.6 on sparc somehow does not see this. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (4.6,
+ "-Warray-bounds");
+ info[dyn->d_tag - DT_LOPROC + DT_NUM] = dyn;
+ DIAG_POP_NEEDS_COMMENT;
+ }
else if ((d_tag_utype) DT_VERSIONTAGIDX (dyn->d_tag) < DT_VERSIONTAGNUM)
info[VERSYMIDX (dyn->d_tag)] = dyn;
else if ((d_tag_utype) DT_EXTRATAGIDX (dyn->d_tag) < DT_EXTRANUM)