aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-02-23 09:46:49 +0000
committerNick Clifton <nickc@redhat.com>2005-02-23 09:46:49 +0000
commit4b6c0f2fe96d8e38bfa8c8d98b656f34f629d09f (patch)
tree90ac9ecb37be094676254c868b4f5e49587ab332 /bfd/elf.c
parentc3e8c140a39edfc1a8e94991c2bcc1afb33202e0 (diff)
downloadgdb-4b6c0f2fe96d8e38bfa8c8d98b656f34f629d09f.zip
gdb-4b6c0f2fe96d8e38bfa8c8d98b656f34f629d09f.tar.gz
gdb-4b6c0f2fe96d8e38bfa8c8d98b656f34f629d09f.tar.bz2
(_bfd_elf_compute_section_file_positions): Initialise strtab to avoid compile
time warning.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index dd76dad..504f735 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3233,7 +3233,7 @@ _bfd_elf_compute_section_file_positions (bfd *abfd,
{
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
bfd_boolean failed;
- struct bfd_strtab_hash *strtab;
+ struct bfd_strtab_hash *strtab = NULL;
Elf_Internal_Shdr *shstrtab_hdr;
if (abfd->output_has_begun)
@@ -4223,6 +4223,12 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
p->p_filesz += sec->size;
p->p_memsz += sec->size;
}
+ /* PR ld/594: Sections in note segments which are not loaded
+ contribute to the file size but not the in-memory size. */
+ else if (p->p_type == PT_NOTE
+ && (flags & SEC_HAS_CONTENTS) != 0)
+ p->p_filesz += sec->size;
+
/* .tbss is special. It doesn't contribute to p_memsz of
normal segments. */
else if ((flags & SEC_THREAD_LOCAL) == 0