aboutsummaryrefslogtreecommitdiff
path: root/bfd/section.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-11-13 03:52:25 +0000
committerAlan Modra <amodra@gmail.com>2001-11-13 03:52:25 +0000
commit4e6bfe8ada4bae838d47c169d1cc2899db66ff19 (patch)
treeb52700e72a623011f4f118ad7a9719b96d735b30 /bfd/section.c
parente4afe7429548beac154bb41d8f553d614a222d17 (diff)
downloadgdb-4e6bfe8ada4bae838d47c169d1cc2899db66ff19.zip
gdb-4e6bfe8ada4bae838d47c169d1cc2899db66ff19.tar.gz
gdb-4e6bfe8ada4bae838d47c169d1cc2899db66ff19.tar.bz2
* section.c (bfd_make_section_anyway): Don't increment section_id
and the BFD's section_count if adding the section failed. * vms.c (vms_new_section_hook): Adjust for bfd_make_section_anyway change.
Diffstat (limited to 'bfd/section.c')
-rw-r--r--bfd/section.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bfd/section.c b/bfd/section.c
index 53491f1..0d95f11 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -796,8 +796,8 @@ bfd_make_section_anyway (abfd, name)
return NULL;
newsect->name = name;
- newsect->id = section_id++;
- newsect->index = abfd->section_count++;
+ newsect->id = section_id;
+ newsect->index = abfd->section_count;
newsect->flags = SEC_NO_FLAGS;
newsect->userdata = NULL;
@@ -831,6 +831,8 @@ bfd_make_section_anyway (abfd, name)
return NULL;
}
+ section_id++;
+ abfd->section_count++;
*prev = newsect;
return newsect;
}