more XCOFF linker tweaks
This commit is contained in:
parent
27b4433688
commit
aad2c618d3
|
@ -14,6 +14,8 @@ Thu Oct 26 14:16:47 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||||
based on sections stored in xcoff_data.
|
based on sections stored in xcoff_data.
|
||||||
* coff-rs6000.c (xcoff_copy_private_bfd_data): Copy new xcoff_data
|
* coff-rs6000.c (xcoff_copy_private_bfd_data): Copy new xcoff_data
|
||||||
fields.
|
fields.
|
||||||
|
(xcoff_reloc_type_lookup): Handle BFD_RELOC_CTOR.
|
||||||
|
(rs6000coff_vec): Set symbol_leading_char to '.'.
|
||||||
* coffgen.c (coff_get_symbol_info): If fix_value is set, fix the
|
* coffgen.c (coff_get_symbol_info): If fix_value is set, fix the
|
||||||
value stored in ret rather than returning a pointer value.
|
value stored in ret rather than returning a pointer value.
|
||||||
|
|
||||||
|
|
|
@ -506,6 +506,7 @@ xcoff_reloc_type_lookup (abfd, code)
|
||||||
case BFD_RELOC_PPC_TOC16:
|
case BFD_RELOC_PPC_TOC16:
|
||||||
return &xcoff_howto_table[3];
|
return &xcoff_howto_table[3];
|
||||||
case BFD_RELOC_32:
|
case BFD_RELOC_32:
|
||||||
|
case BFD_RELOC_CTOR:
|
||||||
return &xcoff_howto_table[0];
|
return &xcoff_howto_table[0];
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1352,7 +1353,8 @@ const bfd_target rs6000coff_vec =
|
||||||
HAS_SYMS | HAS_LOCALS | WP_TEXT),
|
HAS_SYMS | HAS_LOCALS | WP_TEXT),
|
||||||
|
|
||||||
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
|
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
|
||||||
0, /* leading char */
|
/* Making the leading_char a period should make for nicer messages. */
|
||||||
|
'.', /* leading char */
|
||||||
'/', /* ar_pad_char */
|
'/', /* ar_pad_char */
|
||||||
15, /* ar_max_namelen??? FIXMEmgo */
|
15, /* ar_max_namelen??? FIXMEmgo */
|
||||||
|
|
||||||
|
|
|
@ -603,7 +603,8 @@ xcoff_read_internal_relocs (abfd, sec, cache, external_relocs,
|
||||||
if (enclosing != NULL
|
if (enclosing != NULL
|
||||||
&& (coff_section_data (abfd, enclosing) == NULL
|
&& (coff_section_data (abfd, enclosing) == NULL
|
||||||
|| coff_section_data (abfd, enclosing)->relocs == NULL)
|
|| coff_section_data (abfd, enclosing)->relocs == NULL)
|
||||||
&& cache)
|
&& cache
|
||||||
|
&& enclosing->reloc_count > 0)
|
||||||
{
|
{
|
||||||
if (_bfd_coff_read_internal_relocs (abfd, enclosing, true,
|
if (_bfd_coff_read_internal_relocs (abfd, enclosing, true,
|
||||||
external_relocs, false,
|
external_relocs, false,
|
||||||
|
@ -1478,6 +1479,7 @@ xcoff_link_add_symbols (abfd, info)
|
||||||
if (sym.n_sclass == C_EXT)
|
if (sym.n_sclass == C_EXT)
|
||||||
{
|
{
|
||||||
csect->flags |= SEC_IS_COMMON;
|
csect->flags |= SEC_IS_COMMON;
|
||||||
|
csect->_raw_size = 0;
|
||||||
section = csect;
|
section = csect;
|
||||||
value = aux.x_csect.x_scnlen.l;
|
value = aux.x_csect.x_scnlen.l;
|
||||||
}
|
}
|
||||||
|
@ -1533,7 +1535,7 @@ xcoff_link_add_symbols (abfd, info)
|
||||||
|
|
||||||
if (! (_bfd_generic_link_add_one_symbol
|
if (! (_bfd_generic_link_add_one_symbol
|
||||||
(info, abfd, name, flags, section, value,
|
(info, abfd, name, flags, section, value,
|
||||||
(const char *) NULL, copy, false,
|
(const char *) NULL, copy, true,
|
||||||
(struct bfd_link_hash_entry **) sym_hash)))
|
(struct bfd_link_hash_entry **) sym_hash)))
|
||||||
goto error_return;
|
goto error_return;
|
||||||
|
|
||||||
|
@ -1640,7 +1642,7 @@ xcoff_link_add_symbols (abfd, info)
|
||||||
(info, abfd, hds->root.root.string,
|
(info, abfd, hds->root.root.string,
|
||||||
(flagword) 0, bfd_und_section_ptr,
|
(flagword) 0, bfd_und_section_ptr,
|
||||||
(bfd_vma) 0, (const char *) NULL, false,
|
(bfd_vma) 0, (const char *) NULL, false,
|
||||||
false,
|
true,
|
||||||
(struct bfd_link_hash_entry **) NULL)))
|
(struct bfd_link_hash_entry **) NULL)))
|
||||||
goto error_return;
|
goto error_return;
|
||||||
}
|
}
|
||||||
|
@ -2578,6 +2580,18 @@ xcoff_build_ldsyms (h, p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If this is still a common symbol, and it wasn't garbage
|
||||||
|
collected, we need to actually allocate space for it in the .bss
|
||||||
|
section. */
|
||||||
|
if (h->root.type == bfd_link_hash_common
|
||||||
|
&& (! xcoff_hash_table (ldinfo->info)->gc
|
||||||
|
|| (h->flags & XCOFF_MARK) != 0)
|
||||||
|
&& h->root.u.c.p->section->_raw_size == 0)
|
||||||
|
{
|
||||||
|
BFD_ASSERT (bfd_is_com_section (h->root.u.c.p->section));
|
||||||
|
h->root.u.c.p->section->_raw_size = h->root.u.c.size;
|
||||||
|
}
|
||||||
|
|
||||||
/* We need to add a symbol to the .loader section if it is mentioned
|
/* We need to add a symbol to the .loader section if it is mentioned
|
||||||
in a reloc which we are copying to the .loader section and it was
|
in a reloc which we are copying to the .loader section and it was
|
||||||
not defined or common, or if it is the entry point. */
|
not defined or common, or if it is the entry point. */
|
||||||
|
@ -4792,6 +4806,14 @@ _bfd_ppc_xcoff_relocate_section (output_bfd, info, input_bfd,
|
||||||
+ sec->output_section->vma
|
+ sec->output_section->vma
|
||||||
+ sec->output_offset);
|
+ sec->output_offset);
|
||||||
}
|
}
|
||||||
|
else if (h->root.type == bfd_link_hash_common)
|
||||||
|
{
|
||||||
|
asection *sec;
|
||||||
|
|
||||||
|
sec = h->root.u.c.p->section;
|
||||||
|
val = (sec->output_section->vma
|
||||||
|
+ sec->output_offset);
|
||||||
|
}
|
||||||
else if ((h->flags & XCOFF_REF_DYNAMIC) != 0
|
else if ((h->flags & XCOFF_REF_DYNAMIC) != 0
|
||||||
|| (h->flags & XCOFF_IMPORT) != 0)
|
|| (h->flags & XCOFF_IMPORT) != 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue