* xcofflink.c (xcoff_link_add_symbols): Set the alignment power of

the created .tc section to 2.
	(xcoff_mark): Don't keep a .loader reloc for a call to an
	undefined symbol when creating a shared library.
	(xcoff_build_ldsyms): When creating a shared library, generate
	global linkage code for a call to an undefined symbol.
This commit is contained in:
Ian Lance Taylor 1995-11-06 19:36:29 +00:00
parent 7ae3065c8f
commit 83c23fca5b
2 changed files with 19 additions and 5 deletions

View File

@ -1,3 +1,12 @@
Mon Nov 6 14:34:07 1995 Ian Lance Taylor <ian@cygnus.com>
* xcofflink.c (xcoff_link_add_symbols): Set the alignment power of
the created .tc section to 2.
(xcoff_mark): Don't keep a .loader reloc for a call to an
undefined symbol when creating a shared library.
(xcoff_build_ldsyms): When creating a shared library, generate
global linkage code for a call to an undefined symbol.
Sun Nov 5 21:44:13 1995 Ken Raeburn <raeburn@cygnus.com> Sun Nov 5 21:44:13 1995 Ken Raeburn <raeburn@cygnus.com>
* Makefile.in (CFILES): Rebuild list from BFD_LIBS, ALL_MACHINES, * Makefile.in (CFILES): Rebuild list from BFD_LIBS, ALL_MACHINES,

View File

@ -939,6 +939,7 @@ xcoff_link_add_symbols (abfd, info)
goto error_return; goto error_return;
xcoff_hash_table (info)->toc_section = tsec; xcoff_hash_table (info)->toc_section = tsec;
tsec->flags |= SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY; tsec->flags |= SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
tsec->alignment_power = 2;
} }
/* Likewise for the .debug section. */ /* Likewise for the .debug section. */
if (xcoff_hash_table (info)->debug_section == NULL) if (xcoff_hash_table (info)->debug_section == NULL)
@ -2066,7 +2067,8 @@ xcoff_mark (info, sec)
|| h->root.type == bfd_link_hash_common || h->root.type == bfd_link_hash_common
|| ((h->flags & XCOFF_CALLED) != 0 || ((h->flags & XCOFF_CALLED) != 0
&& (h->flags & XCOFF_DEF_REGULAR) == 0 && (h->flags & XCOFF_DEF_REGULAR) == 0
&& (h->flags & XCOFF_REF_DYNAMIC) != 0 && ((h->flags & XCOFF_REF_DYNAMIC) != 0
|| info->shared)
&& (h->root.type == bfd_link_hash_undefined && (h->root.type == bfd_link_hash_undefined
|| h->root.type == bfd_link_hash_undefweak) || h->root.type == bfd_link_hash_undefweak)
&& h->root.root.string[0] == '.')) && h->root.root.string[0] == '.'))
@ -2734,13 +2736,15 @@ xcoff_build_ldsyms (h, p)
h->flags |= XCOFF_MARK; h->flags |= XCOFF_MARK;
/* If this symbol is called, and it is defined in a dynamic object, /* If this symbol is called, and it is defined in a dynamic object,
then we need to set up global linkage code for it. (Unless we or if we are creating a dynamic object and it is not defined at
did garbage collection and we didn't need this symbol.) */ all, then we need to set up global linkage code for it. (Unless
we did garbage collection and we didn't need this symbol.) */
if ((h->flags & XCOFF_CALLED) != 0 if ((h->flags & XCOFF_CALLED) != 0
&& (h->flags & XCOFF_DEF_REGULAR) == 0 && (h->flags & XCOFF_DEF_REGULAR) == 0
&& (h->flags & XCOFF_REF_DYNAMIC) != 0
&& (h->root.type == bfd_link_hash_undefined && (h->root.type == bfd_link_hash_undefined
|| h->root.type == bfd_link_hash_undefweak) || h->root.type == bfd_link_hash_undefweak)
&& ((h->flags & XCOFF_REF_DYNAMIC) != 0
|| ldinfo->info->shared)
&& h->root.root.string[0] == '.' && h->root.root.string[0] == '.'
&& (! xcoff_hash_table (ldinfo->info)->gc && (! xcoff_hash_table (ldinfo->info)->gc
|| (h->flags & XCOFF_MARK) != 0)) || (h->flags & XCOFF_MARK) != 0))
@ -2761,7 +2765,8 @@ xcoff_build_ldsyms (h, p)
BFD_ASSERT ((hds->root.type == bfd_link_hash_undefined BFD_ASSERT ((hds->root.type == bfd_link_hash_undefined
|| hds->root.type == bfd_link_hash_undefweak) || hds->root.type == bfd_link_hash_undefweak)
&& (hds->flags & XCOFF_DEF_REGULAR) == 0 && (hds->flags & XCOFF_DEF_REGULAR) == 0
&& (hds->flags & XCOFF_REF_DYNAMIC) != 0); && ((hds->flags & XCOFF_REF_DYNAMIC) != 0
|| ldinfo->info->shared));
hds->flags |= XCOFF_MARK; hds->flags |= XCOFF_MARK;
if (hds->toc_section == NULL) if (hds->toc_section == NULL)
{ {