aboutsummaryrefslogtreecommitdiff
path: root/bfd/vms-alpha.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2010-05-03 16:04:32 +0000
committerTristan Gingold <gingold@adacore.com>2010-05-03 16:04:32 +0000
commitfa23f0f49a6179dcc7252e660ad60f1cf87665f2 (patch)
treeeec4b96ca67d268d4a9b43a3317ad5fcc53a3726 /bfd/vms-alpha.c
parent278582cb37ac74c4ffeec3dc6c4730510063ca56 (diff)
downloadfsf-binutils-gdb-fa23f0f49a6179dcc7252e660ad60f1cf87665f2.zip
fsf-binutils-gdb-fa23f0f49a6179dcc7252e660ad60f1cf87665f2.tar.gz
fsf-binutils-gdb-fa23f0f49a6179dcc7252e660ad60f1cf87665f2.tar.bz2
bfd/
2010-05-03 Tristan Gingold <gingold@adacore.com> * vms-lib.c (vms_lib_bopen): Fix the size threshold to read selective_search flag. Add comments. * vms-alpha.c (alpha_vms_bfd_final_link): Create the DMT section before output_has_begun is set.
Diffstat (limited to 'bfd/vms-alpha.c')
-rw-r--r--bfd/vms-alpha.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c
index 92d0693..5ae54c2 100644
--- a/bfd/vms-alpha.c
+++ b/bfd/vms-alpha.c
@@ -8364,6 +8364,7 @@ alpha_vms_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
bfd_vma base_addr;
bfd_vma last_addr;
asection *dst;
+ asection *dmt;
bfd_get_outsymbols (abfd) = NULL;
bfd_get_symcount (abfd) = 0;
@@ -8478,6 +8479,21 @@ alpha_vms_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
alpha_vms_link_hash (info)->fixup = fixupsec;
alpha_vms_link_hash (info)->base_addr = base_addr;
+ /* Create the DMT section, if necessary. */
+ dst = PRIV (dst_section);
+ if (dst != NULL && dst->size == 0)
+ dst = NULL;
+ if (dst != NULL)
+ {
+ dmt = bfd_make_section_anyway_with_flags
+ (info->output_bfd, "$DMT$",
+ SEC_DEBUGGING | SEC_HAS_CONTENTS | SEC_LINKER_CREATED);
+ if (dmt == NULL)
+ return FALSE;
+ }
+ else
+ dmt = NULL;
+
/* Read all sections from the inputs. */
for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
{
@@ -8491,7 +8507,8 @@ alpha_vms_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
return FALSE;
}
- /* Handle all the link order information for the sections. */
+ /* Handle all the link order information for the sections.
+ Note: past this point, it is not possible to create new sections. */
for (o = abfd->sections; o != NULL; o = o->next)
{
for (p = o->map_head.link_order; p != NULL; p = p->next)
@@ -8518,21 +8535,11 @@ alpha_vms_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
return FALSE;
/* Compute the DMT. */
- dst = PRIV (dst_section);
- if (dst != NULL && dst->size == 0)
- dst = NULL;
- if (dst != NULL)
+ if (dmt != NULL)
{
- asection *dmt;
int pass;
unsigned char *contents = NULL;
- dmt = bfd_make_section_anyway_with_flags
- (info->output_bfd, "$DMT$",
- SEC_DEBUGGING | SEC_HAS_CONTENTS | SEC_LINKER_CREATED);
- if (dmt == NULL)
- return FALSE;
-
/* In pass 1, compute the size. In pass 2, write the DMT contents. */
for (pass = 0; pass < 2; pass++)
{