Module Name:src
Committed By: riz
Date: Mon Sep 3 18:59:24 UTC 2012
Modified Files:
src/external/gpl3/binutils/dist/bfd [netbsd-6]: elf32-vax.c
Log Message:
Pull up following revision(s) (requested by martin in ticket #531):
external/gpl3/binutils/dist/bfd/elf32-vax.c: revision 1.7
Make this to produce working shared libraries again.
Resultant distribution was booted into single user using shared libraries.
To generate a diff of this commit:
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 \
src/external/gpl3/binutils/dist/bfd/elf32-vax.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/gpl3/binutils/dist/bfd/elf32-vax.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.5.2.1 src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.5.2.2
--- src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.5.2.1 Wed Jul 25 15:09:34 2012
+++ src/external/gpl3/binutils/dist/bfd/elf32-vax.c Mon Sep 3 18:59:23 2012
@@ -52,7 +52,7 @@ static bfd_vma elf_vax_plt_sym_val (bfd_
static bfd_boolean elf32_vax_set_private_flags (bfd *, flagword);
static bfd_boolean elf32_vax_merge_private_bfd_data (bfd *, bfd *);
-static bfd_boolean elf32_vax_print_private_bfd_data (bfd *, PTR);
+static bfd_boolean elf32_vax_print_private_bfd_data (bfd *, void *);
static reloc_howto_type howto_table[] = {
HOWTO (R_VAX_NONE, /* type */
@@ -422,7 +422,7 @@ static bfd_boolean elf_vax_instantiate_g
#define elf_vax_link_hash_traverse(table, func, info) \
(elf_link_hash_traverse \
((table),\
-(bfd_boolean (*) (struct elf_link_hash_entry *, PTR)) (func), \
+(bfd_boolean (*) (struct elf_link_hash_entry *, void *)) (func), \
(info)))
/* Create an entry in an VAX ELF linker hash table. */
@@ -531,7 +531,7 @@ elf32_vax_merge_private_bfd_data (bfd *i
/* Display the flags field */
static bfd_boolean
-elf32_vax_print_private_bfd_data (bfd *abfd, PTR ptr)
+elf32_vax_print_private_bfd_data (bfd *abfd, void * ptr)
{
FILE *file = (FILE *) ptr;
@@ -640,14 +640,13 @@ elf_vax_check_relocs (bfd *abfd, struct
srelgot = bfd_get_section_by_name (dynobj, .rela.got);
if (srelgot == NULL)
{
+ flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
+| SEC_IN_MEMORY | SEC_LINKER_CREATED
+| SEC_READONLY);
+
srelgot = bfd_make_section_with_flags (dynobj,
.rela.got,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED
- | SEC_READONLY));
+ flags);
if (srelgot == NULL
|| !bfd_set_section_alignment (dynobj, srelgot, 2))
return FALSE;
@@ -769,30 +768,14 @@ elf_vax_check_relocs (bfd *abfd, struct
if (sreloc == NULL)
return FALSE;
-#if 0
- BFD_ASSERT (CONST_STRNEQ (name, .rela)
- strcmp (bfd_get_section_name (abfd, sec),
- name + 5) == 0);
-
- sreloc = bfd_get_section_by_name (dynobj, name);
- if (sreloc == NULL)
+ if (sec-flags SEC_READONLY)
{
- sreloc = bfd_make_section_with_flags (dynobj,
- name,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED
- | SEC_READONLY));
- if (sreloc == NULL
- || !bfd_set_section_alignment (dynobj, sreloc, 2))
- return FALSE;
+ if (info-warn_shared_textrel)
+ (*_bfd_error_handler)
+ (_(warning: dynamic relocation in readonly section `%s'),
+ sec-name);
+ info-flags |= DF_TEXTREL;
}
-#endif
-
- if (sec-flags SEC_READONLY)
- info-flags |= DF_TEXTREL;
}
sreloc-size += sizeof (Elf32_External_Rela);
@@ -973,14 +956,14 @@ elf_vax_adjust_dynamic_symbol (info, h)
if (h-type == STT_FUNC
|| h-needs_plt)
{
- if (h-plt.refcount == 0
- || SYMBOL_CALLS_LOCAL (info, 0)
+ if (h-plt.refcount = 0
+ || SYMBOL_CALLS_LOCAL (info, h)
|| (ELF_ST_VISIBILITY (h-other) != STV_DEFAULT
h-root.type == bfd_link_hash_undefweak))
{
/* This case can occur if we saw a PLTxx reloc in an input
file, but the symbol was never referred to by a dynamic
- object, or if all references were garbage collected.. In
+ object, or if all references were garbage collected. In
such a case, we don't actually need to build a procedure
linkage table, and we can just do a PCxx reloc instead. */
h-plt.offset = (bfd_vma) -1;
@@ -1057,13 +1040,6 @@ elf_vax_adjust_dynamic_symbol (info, h)
if (info-shared)
return TRUE;
- if (h-size == 0)
-{
- (*_bfd_error_handler) (_(dynamic variable `%s' is zero size),
- h-root.root.string);
- return TRUE;
-}
-
/* We must allocate the symbol in our .dynbss section, which will
become part of the .bss section of the executable. There will be
an entry for this symbol in the