From 3dce57716fc4fea36d4b64f07d969de7631b73ef Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 23 Feb 2005 09:46:49 +0000 Subject: [PATCH] (_bfd_elf_compute_section_file_positions): Initialise strtab to avoid compile time warning. --- bfd/ChangeLog | 5 +++++ bfd/elf.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c0d85082b..36bd34a30 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2005-02-23 Nick Clifton + + * elf.c (_bfd_elf_compute_section_file_positions): Initialise + strtab to avoid compile time warning. + 2005-02-23 Ben Elliston * opncls.c (bfd_zalloc): Document this function. diff --git a/bfd/elf.c b/bfd/elf.c index dd76dadc7..504f73584 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 -- 2.11.4.GIT