aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-11-03 02:53:38 +0000
committerAlan Modra <amodra@gmail.com>2005-11-03 02:53:38 +0000
commit3a800eb947748a8cad1b13ed485b5dce1b4cfc4b (patch)
treef4c51f4e56ccd75ae0a21bb8a866196fbfa42deb /bfd/elflink.c
parent6ed89c00083351e911fc11f817b1fdb7d21b7a7b (diff)
downloadgdb-3a800eb947748a8cad1b13ed485b5dce1b4cfc4b.zip
gdb-3a800eb947748a8cad1b13ed485b5dce1b4cfc4b.tar.gz
gdb-3a800eb947748a8cad1b13ed485b5dce1b4cfc4b.tar.bz2
* elf.c (elf_fake_sections): When calculating tbss size, just use
the last link_order. (assign_file_positions_for_segments): Likewise. * elflink.c (bfd_elf_final_link): Likewise. (elf_reloc_link_order): Correct comment.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 899c48d..1fcfce3 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -7394,7 +7394,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
}
/* Generate a reloc when linking an ELF file. This is a reloc
- requested by the linker, and does come from any input file. This
+ requested by the linker, and does not come from any input file. This
is used to build constructor and destructor tables when linking
with -Ur. */
@@ -8129,15 +8129,14 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
sec && (sec->flags & SEC_THREAD_LOCAL);
sec = sec->next)
{
- bfd_vma size = sec->size;
+ bfd_size_type size = sec->size;
- if (size == 0 && (sec->flags & SEC_HAS_CONTENTS) == 0)
+ if (size == 0
+ && (sec->flags & SEC_HAS_CONTENTS) == 0)
{
- struct bfd_link_order *o;
-
- for (o = sec->map_head.link_order; o != NULL; o = o->next)
- if (size < o->offset + o->size)
- size = o->offset + o->size;
+ struct bfd_link_order *o = sec->map_tail.link_order;
+ if (o != NULL)
+ size = o->offset + o->size;
}
end = sec->vma + size;
}