+Fri Jun 12 13:34:02 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * elf.c (swap_out_syms): New arg relocatable_p.
+ Don't add section VMA to symbols for relocatable output.
+ (_bfd_elf_compute_section_file_positions): Update call to
+ swap_out_syms.
+
Mon Jun 8 15:20:57 1998 Nick Clifton <nickc@cygnus.com>
* elf32-v850.c (v850_elf_perform_relocation): Make comparisons
static boolean assign_file_positions_for_segments PARAMS ((bfd *));
static boolean assign_file_positions_except_relocs PARAMS ((bfd *));
static boolean prep_headers PARAMS ((bfd *));
-static boolean swap_out_syms PARAMS ((bfd *, struct bfd_strtab_hash **));
+static boolean swap_out_syms PARAMS ((bfd *, struct bfd_strtab_hash **, int));
static boolean copy_private_bfd_data PARAMS ((bfd *, bfd *));
static char *elf_read PARAMS ((bfd *, long, unsigned int));
static void elf_fake_sections PARAMS ((bfd *, asection *, PTR));
/* The backend linker builds symbol table information itself. */
if (link_info == NULL && abfd->symcount > 0)
{
- if (! swap_out_syms (abfd, &strtab))
+ /* Non-zero if doing a relocatable link. */
+ int relocatable_p = ! (abfd->flags & (EXEC_P | DYNAMIC));
+
+ if (! swap_out_syms (abfd, &strtab, relocatable_p))
return false;
}
/* Swap out the symbols. */
static boolean
-swap_out_syms (abfd, sttp)
+swap_out_syms (abfd, sttp, relocatable_p)
bfd *abfd;
struct bfd_strtab_hash **sttp;
+ int relocatable_p;
{
struct elf_backend_data *bed = get_elf_backend_data (abfd);
value += sec->output_offset;
sec = sec->output_section;
}
- value += sec->vma;
+ /* Don't add in the section vma for relocatable output. */
+ if (! relocatable_p)
+ value += sec->vma;
sym.st_value = value;
sym.st_size = type_ptr ? type_ptr->internal_elf_sym.st_size : 0;