aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-ip2k.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-02-22 18:11:25 +1030
committerAlan Modra <amodra@gmail.com>2023-02-23 12:58:53 +1030
commit98571cade24f890418faf183a21a3a4f0129f960 (patch)
tree9e3c715149a5968273ebb86b68365b39fe4efc96 /bfd/elf32-ip2k.c
parent3a574cce26ee7dca6d6cd4c756dec57a5c0b9c99 (diff)
downloadgdb-98571cade24f890418faf183a21a3a4f0129f960.zip
gdb-98571cade24f890418faf183a21a3a4f0129f960.tar.gz
gdb-98571cade24f890418faf183a21a3a4f0129f960.tar.bz2
ip2k: don't look at stab sections without relocs
No need to read contents if we won't do anything. * elf32-ip2k.c (adjust_all_relocations): Skip stab sections without relocs.
Diffstat (limited to 'bfd/elf32-ip2k.c')
-rw-r--r--bfd/elf32-ip2k.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c
index cb1ab0e..9010437 100644
--- a/bfd/elf32-ip2k.c
+++ b/bfd/elf32-ip2k.c
@@ -623,7 +623,7 @@ adjust_all_relocations (bfd *abfd,
/* Now fix the stab relocations. */
stab = bfd_get_section_by_name (abfd, ".stab");
- if (stab)
+ if (stab && stab->reloc_count != 0)
{
bfd_byte *stabcontents, *stabend, *stabp;
bfd_size_type stab_size = stab->rawsize ? stab->rawsize : stab->size;