mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-02 10:47:11 +08:00
* ldlang.c (wild_doit): Don't bother initializing the vma and
section size. Don't special case SEC_SHARED_LIBRARY. (lang_size_sections): Handle SEC_COFF_SHARED_LIBRARY sections specially.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
Tue May 10 14:31:16 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
||||||
|
|
||||||
|
* ldlang.c (wild_doit): Don't bother initializing the vma and
|
||||||
|
section size. Don't special case SEC_SHARED_LIBRARY.
|
||||||
|
(lang_size_sections): Handle SEC_COFF_SHARED_LIBRARY sections
|
||||||
|
specially.
|
||||||
|
|
||||||
Fri May 6 12:24:27 1994 Steve Chamberlain (sac@cygnus.com)
|
Fri May 6 12:24:27 1994 Steve Chamberlain (sac@cygnus.com)
|
||||||
|
|
||||||
* config/go32.mh : New file for Xgo32X.
|
* config/go32.mh : New file for Xgo32X.
|
||||||
|
63
ld/ldlang.c
63
ld/ldlang.c
@ -662,18 +662,7 @@ wild_doit (ptr, section, output, file)
|
|||||||
lang_input_statement_type * file;
|
lang_input_statement_type * file;
|
||||||
{
|
{
|
||||||
if (output->bfd_section == (asection *) NULL)
|
if (output->bfd_section == (asection *) NULL)
|
||||||
{
|
|
||||||
init_os (output);
|
init_os (output);
|
||||||
/* Initialize the vma and size to the existing section. This will
|
|
||||||
be overriden in lang_size_sections unless SEC_NEVER_LOAD gets
|
|
||||||
set. */
|
|
||||||
if (section != (asection *) NULL)
|
|
||||||
{
|
|
||||||
bfd_set_section_vma (0, output->bfd_section,
|
|
||||||
bfd_section_vma (0, section));
|
|
||||||
output->bfd_section->_raw_size = section->_raw_size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (section != (asection *) NULL
|
if (section != (asection *) NULL
|
||||||
&& section->output_section == (asection *) NULL)
|
&& section->output_section == (asection *) NULL)
|
||||||
@ -685,12 +674,12 @@ wild_doit (ptr, section, output, file)
|
|||||||
new->ifile = file;
|
new->ifile = file;
|
||||||
section->output_section = output->bfd_section;
|
section->output_section = output->bfd_section;
|
||||||
|
|
||||||
/* Be selective about what the output section inherits from the
|
/* We don't copy the SEC_NEVER_LOAD flag from an input section to
|
||||||
input section */
|
an output section, because we want to be able to include a
|
||||||
|
SEC_NEVER_LOAD section in the middle of an otherwise loaded
|
||||||
if ((section->flags & SEC_SHARED_LIBRARY) != 0)
|
section (I don't know why we want to do this, but we do).
|
||||||
section->output_section->flags |= section->flags;
|
build_link_order in ldwrite.c handles this case by turning the
|
||||||
else
|
embedded SEC_NEVER_LOAD section into a fill. */
|
||||||
section->output_section->flags |=
|
section->output_section->flags |=
|
||||||
section->flags & (flagword) (~ SEC_NEVER_LOAD);
|
section->flags & (flagword) (~ SEC_NEVER_LOAD);
|
||||||
|
|
||||||
@ -1650,10 +1639,27 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
|
|||||||
bfd_vma after;
|
bfd_vma after;
|
||||||
lang_output_section_statement_type *os = &s->output_section_statement;
|
lang_output_section_statement_type *os = &s->output_section_statement;
|
||||||
|
|
||||||
/* If this is a shared library section, don't change the size
|
/* If this is a COFF shared library section, use the size and
|
||||||
and address. */
|
address from the input section. FIXME: This is COFF
|
||||||
if (os->bfd_section->flags & SEC_SHARED_LIBRARY)
|
specific; it would be cleaner if there were some other way
|
||||||
|
to do this, but nothing simple comes to mind. */
|
||||||
|
if ((os->bfd_section->flags & SEC_COFF_SHARED_LIBRARY) != 0)
|
||||||
|
{
|
||||||
|
asection *input;
|
||||||
|
|
||||||
|
if (os->children.head == NULL
|
||||||
|
|| os->children.head->next != NULL
|
||||||
|
|| os->children.head->header.type != lang_input_section_enum)
|
||||||
|
einfo ("%P%X: Internal error on COFF shared library section %s",
|
||||||
|
os->name);
|
||||||
|
|
||||||
|
input = os->children.head->input_section.section;
|
||||||
|
bfd_set_section_vma (os->bfd_section->owner,
|
||||||
|
os->bfd_section,
|
||||||
|
bfd_section_vma (input->owner, input));
|
||||||
|
os->bfd_section->_raw_size = input->_raw_size;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (os->bfd_section == &bfd_abs_section)
|
if (os->bfd_section == &bfd_abs_section)
|
||||||
{
|
{
|
||||||
@ -1852,11 +1858,19 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
|
|||||||
&newdot);
|
&newdot);
|
||||||
|
|
||||||
if (newdot != dot && !relax)
|
if (newdot != dot && !relax)
|
||||||
/* We've been moved ! so insert a pad */
|
{
|
||||||
|
/* The assignment changed dot. Insert a pad. */
|
||||||
|
if (output_section_statement == abs_output_section)
|
||||||
|
{
|
||||||
|
/* If we don't have an output section, then just adjust
|
||||||
|
the default memory address. */
|
||||||
|
lang_memory_region_lookup ("*default*")->current = newdot;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
lang_statement_union_type *new =
|
lang_statement_union_type *new =
|
||||||
(lang_statement_union_type *)
|
((lang_statement_union_type *)
|
||||||
stat_alloc ((bfd_size_type) (sizeof (lang_padding_statement_type)));
|
stat_alloc (sizeof (lang_padding_statement_type)));
|
||||||
|
|
||||||
/* Link into existing chain */
|
/* Link into existing chain */
|
||||||
new->header.next = *prev;
|
new->header.next = *prev;
|
||||||
@ -1870,10 +1884,11 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
|
|||||||
new->padding_statement.size = newdot - dot;
|
new->padding_statement.size = newdot - dot;
|
||||||
output_section_statement->bfd_section->_raw_size +=
|
output_section_statement->bfd_section->_raw_size +=
|
||||||
new->padding_statement.size;
|
new->padding_statement.size;
|
||||||
|
}
|
||||||
|
|
||||||
dot = newdot;
|
dot = newdot;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case lang_padding_statement_enum:
|
case lang_padding_statement_enum:
|
||||||
|
Reference in New Issue
Block a user