From f0b5bb34d5c2c7023c5e54789743e398ab5669c0 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 2 Jun 2006 00:32:00 +0000 Subject: bfd/ PR ld/2723 * elflink.c (bfd_elf_final_link): Don't output section symbols for special ELF sections. ld/testsuite/ Update for removal of some section syms. --- bfd/elflink.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'bfd/elflink.c') diff --git a/bfd/elflink.c b/bfd/elflink.c index df2b7e9..c5b1007 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -8125,18 +8125,19 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) elfsym.st_size = 0; elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION); elfsym.st_other = 0; + elfsym.st_value = 0; for (i = 1; i < elf_numsections (abfd); i++) { o = bfd_section_from_elf_index (abfd, i); if (o != NULL) - o->target_index = bfd_get_symcount (abfd); - elfsym.st_shndx = i; - if (info->relocatable || o == NULL) - elfsym.st_value = 0; - else - elfsym.st_value = o->vma; - if (! elf_link_output_sym (&finfo, NULL, &elfsym, o, NULL)) - goto error_return; + { + o->target_index = bfd_get_symcount (abfd); + elfsym.st_shndx = i; + if (!info->relocatable) + elfsym.st_value = o->vma; + if (!elf_link_output_sym (&finfo, NULL, &elfsym, o, NULL)) + goto error_return; + } if (i == SHN_LORESERVE - 1) i += SHN_HIRESERVE + 1 - SHN_LORESERVE; } -- cgit v1.1