diff options
author | Alan Modra <amodra@bigpond.net.au> | 2001-11-13 03:52:25 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2001-11-13 03:52:25 +0000 |
commit | 7d0eb8c65b1cdef977666a0304e79538fe1b527e (patch) | |
tree | 13abbbcdc8c7ca36661c28c02b8a41f69f4262b6 /bfd/vms.c | |
parent | 42061033f7adeb3f96f147cfdb06f54c751a8948 (diff) | |
download | gdb-7d0eb8c65b1cdef977666a0304e79538fe1b527e.tar.gz |
* 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/vms.c')
-rw-r--r-- | bfd/vms.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/bfd/vms.c b/bfd/vms.c index 94fa84e044c..55bcf6193cb 100644 --- a/bfd/vms.c +++ b/bfd/vms.c @@ -733,19 +733,23 @@ vms_new_section_hook (abfd, section) bfd *abfd; asection *section; { + /* Count hasn't been incremented yet. */ + unsigned int section_count = abfd->section_count + 1; + #if VMS_DEBUG - vms_debug (1, "vms_new_section_hook (%p, [%d]%s), count %d\n", abfd, section->index, section->name, abfd->section_count); + vms_debug (1, "vms_new_section_hook (%p, [%d]%s), count %d\n", + abfd, section->index, section->name, section_count); #endif - bfd_set_section_alignment(abfd, section, 4); + bfd_set_section_alignment (abfd, section, 4); - if (abfd->section_count > PRIV (section_count)) + if (section_count > PRIV (section_count)) { - bfd_size_type amt = abfd->section_count; + bfd_size_type amt = section_count; amt *= sizeof (asection *); PRIV (sections) = (asection **) bfd_realloc (PRIV (sections), amt); if (PRIV (sections) == 0) return false; - PRIV (section_count) = abfd->section_count; + PRIV (section_count) = section_count; } #if VMS_DEBUG vms_debug (6, "section_count: %d\n", PRIV (section_count)); |