coordinate info->symbolic and info->allow_shlib_undefined

This commit is contained in:
Nick Clifton 2001-09-20 10:37:35 +00:00
parent 3a42e9d062
commit 671bae9c92
17 changed files with 59 additions and 19 deletions

View File

@ -1,3 +1,23 @@
2001-09-20 John Reiser <jreiser@BitWagon.com>
* elf32-i386.c (elf_i386_relocate_section): coordinate info->symbolic
and info->allow_shlib_undefined.
* elf32-cris.c: likewise
* elf32-hppa.c: likewise
* elf32-m68k.c: likewise
* elf32-mips.c: likewise
* elf32-ppc.c: likewise
* elf32-s390.c: likewise
* elf32-sh.c: likewise
* elf32-sparc.c: likewise
* elf64-alpha.c: likewise
* elf64-hppa.c: likewise
* elf64-ppc.c: likewise
* elf64-s390.c: likewise
* elf64-sparc.c: likewise
* elf64-x86-64.c: likewise
* elfxx-ia64.c: likewise
2001-09-18 Bruno Haible <haible@clisp.cons.org>
* aoutx.h: Include "safe-ctype.h" instead of <ctype.h>.

View File

@ -898,7 +898,7 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared
&& !info->symbolic
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;

View File

@ -3679,7 +3679,7 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
&& ELF_ST_VISIBILITY (h->elf.other) == STV_DEFAULT
&& h->elf.type != STT_PARISC_MILLI)
{
if (info->symbolic)
if (info->symbolic && !info->allow_shlib_undefined)
if (!((*info->callbacks->undefined_symbol)
(info, h->elf.root.root.string, input_bfd,
input_section, rel->r_offset, false)))

View File

@ -1549,7 +1549,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
;
else if (info->shared && !info->symbolic
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
;

View File

@ -1474,7 +1474,8 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared && !info->symbolic
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;

View File

@ -6142,7 +6142,9 @@ mips_elf_calculate_relocation (abfd,
and check to see if they exist by looking at their
addresses. */
symbol = 0;
else if (info->shared && !info->symbolic && !info->no_undefined
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
symbol = 0;
else if (strcmp (h->root.root.root.string, "_DYNAMIC_LINK") == 0 ||

View File

@ -3106,7 +3106,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared && !info->symbolic && !info->no_undefined
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
else

View File

@ -1444,7 +1444,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared && !info->symbolic
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;

View File

@ -3114,7 +3114,9 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared && !info->symbolic && !info->no_undefined)
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined)
relocation = 0;
else
{

View File

@ -1237,7 +1237,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared && !info->symbolic
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;

View File

@ -3346,7 +3346,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared && !info->symbolic
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
relocation = 0;

View File

@ -746,7 +746,8 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs)
have yet been processed. Do something with what we know, as
this may help reduce memory usage and processing time later. */
maybe_dynamic = false;
if (h && ((info->shared && ! info->symbolic)
if (h && ((info->shared
&& (!info->symbolic || info->allow_shlib_undefined) )
|| ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
|| h->root.type == bfd_link_hash_defweak))
maybe_dynamic = true;
@ -973,7 +974,7 @@ elf64_hppa_dynamic_symbol_p (h, info)
if (h->root.root.string[0] == '$' && h->root.root.string[1] == '$')
return false;
if ((info->shared && !info->symbolic)
if ((info->shared && (!info->symbolic || info->allow_shlib_undefined))
|| ((h->elf_link_hash_flags
& (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))
== (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)))

View File

@ -2847,7 +2847,9 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared && !info->symbolic && !info->no_undefined)
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined)
relocation = 0;
else
{

View File

@ -1432,7 +1432,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared && !info->symbolic
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;

View File

@ -2069,7 +2069,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared && !info->symbolic
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;

View File

@ -1300,7 +1300,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared && !info->symbolic && !info->no_undefined
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
else

View File

@ -1429,7 +1429,7 @@ elfNN_ia64_dynamic_symbol_p (h, info)
|| h->root.type == bfd_link_hash_defweak)
return true;
if ((info->shared && !info->symbolic)
if ((info->shared && (!info->symbolic || info->allow_shlib_undefined))
|| ((h->elf_link_hash_flags
& (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))
== (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)))
@ -2020,7 +2020,8 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
have yet been processed. Do something with what we know, as
this may help reduce memory usage and processing time later. */
maybe_dynamic = false;
if (h && ((info->shared && ! info->symbolic)
if (h && ((info->shared
&& (!info->symbolic || info->allow_shlib_undefined))
|| ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
|| h->root.type == bfd_link_hash_defweak
|| elfNN_ia64_aix_vec (abfd->xvec)))
@ -3509,7 +3510,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
undef_weak_ref = true;
else if (info->shared && !info->symbolic
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
;