aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-xtensa.c
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@acm.org>2008-09-18 00:37:47 +0000
committerBob Wilson <bob.wilson@acm.org>2008-09-18 00:37:47 +0000
commitb45329f94ab8c22f8475b1c47e2d1e255cadf422 (patch)
treecd555bad9ddc58bc16c917d5f3cd6c1953999e49 /bfd/elf32-xtensa.c
parentbf43e54522f79e308713c23fcfbd2ef4d873204b (diff)
downloadgdb-b45329f94ab8c22f8475b1c47e2d1e255cadf422.zip
gdb-b45329f94ab8c22f8475b1c47e2d1e255cadf422.tar.gz
gdb-b45329f94ab8c22f8475b1c47e2d1e255cadf422.tar.bz2
* elf32-xtensa.c (elf_xtensa_check_relocs): Check for negative refcount.
Diffstat (limited to 'bfd/elf32-xtensa.c')
-rw-r--r--bfd/elf32-xtensa.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index 3463efa..dadf42b 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -1087,8 +1087,13 @@ elf_xtensa_check_relocs (bfd *abfd,
{
if (is_plt)
{
- h->plt.refcount += 1;
- h->needs_plt = 1;
+ if (h->plt.refcount <= 0)
+ {
+ h->needs_plt = 1;
+ h->plt.refcount = 1;
+ }
+ else
+ h->plt.refcount += 1;
/* Keep track of the total PLT relocation count even if we
don't yet know whether the dynamic sections will be
@@ -1102,7 +1107,12 @@ elf_xtensa_check_relocs (bfd *abfd,
}
}
else if (is_got)
- h->got.refcount += 1;
+ {
+ if (h->got.refcount <= 0)
+ h->got.refcount = 1;
+ else
+ h->got.refcount += 1;
+ }
if (is_tlsfunc)
eh->tlsfunc_refcount += 1;