bfd/
* elf.c (bfd_elf_get_default_section_type): Don't test SEC_NEVER_LOAD. * elflink.c (elf_link_input_bfd): Likewise. ld/ * ld.texinfo (NOLOAD): Do not erroneously state that contents will appear in output file. * ldlang.c (lang_add_section): Clear SEC_HAS_CONTENTS on noload unless SEC_COFF_SHARED_LIBRARY. (map_input_to_output_sections): Don't set SEC_HAS_CONTENTS for noload output sections. (lang_size_sections_1): Don't test SEC_NEVER_LOAD when deciding to update dot in region. Ditto when setting SEC_ALLOC if dot advanced due to assignment. * ldwrite.c (build_link_order): Don't test SEC_NEVER_LOAD.
This commit is contained in:
parent
15ed0ef36b
commit
2e76e85a38
|
@ -1,3 +1,8 @@
|
||||||
|
2010-09-16 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* elf.c (bfd_elf_get_default_section_type): Don't test SEC_NEVER_LOAD.
|
||||||
|
* elflink.c (elf_link_input_bfd): Likewise.
|
||||||
|
|
||||||
2010-09-15 Kai Tietz <kai.tietz@onevision.com>
|
2010-09-15 Kai Tietz <kai.tietz@onevision.com>
|
||||||
|
|
||||||
* pei-x86_64.c (pex64_get_unwind_info): Reorgnized.
|
* pei-x86_64.c (pex64_get_unwind_info): Reorgnized.
|
||||||
|
|
|
@ -2452,8 +2452,7 @@ int
|
||||||
bfd_elf_get_default_section_type (flagword flags)
|
bfd_elf_get_default_section_type (flagword flags)
|
||||||
{
|
{
|
||||||
if ((flags & SEC_ALLOC) != 0
|
if ((flags & SEC_ALLOC) != 0
|
||||||
&& ((flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0
|
&& (flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
|
||||||
|| (flags & SEC_NEVER_LOAD) != 0))
|
|
||||||
return SHT_NOBITS;
|
return SHT_NOBITS;
|
||||||
return SHT_PROGBITS;
|
return SHT_PROGBITS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2829,7 +2829,7 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h,
|
||||||
/* Return true if the symbol referred to by H should be considered
|
/* Return true if the symbol referred to by H should be considered
|
||||||
to resolve local to the current module, and false otherwise. Differs
|
to resolve local to the current module, and false otherwise. Differs
|
||||||
from (the inverse of) _bfd_elf_dynamic_symbol_p in the treatment of
|
from (the inverse of) _bfd_elf_dynamic_symbol_p in the treatment of
|
||||||
undefined symbols. The two functions are vitually identical except
|
undefined symbols. The two functions are virtually identical except
|
||||||
for the place where forced_local and dynindx == -1 are tested. If
|
for the place where forced_local and dynindx == -1 are tested. If
|
||||||
either of those tests are true, _bfd_elf_dynamic_symbol_p will say
|
either of those tests are true, _bfd_elf_dynamic_symbol_p will say
|
||||||
the symbol is local, while _bfd_elf_symbol_refs_local_p will say
|
the symbol is local, while _bfd_elf_symbol_refs_local_p will say
|
||||||
|
@ -9843,7 +9843,6 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
|
||||||
{
|
{
|
||||||
/* FIXME: octets_per_byte. */
|
/* FIXME: octets_per_byte. */
|
||||||
if (! (o->flags & SEC_EXCLUDE)
|
if (! (o->flags & SEC_EXCLUDE)
|
||||||
&& ! (o->output_section->flags & SEC_NEVER_LOAD)
|
|
||||||
&& ! bfd_set_section_contents (output_bfd, o->output_section,
|
&& ! bfd_set_section_contents (output_bfd, o->output_section,
|
||||||
contents,
|
contents,
|
||||||
(file_ptr) o->output_offset,
|
(file_ptr) o->output_offset,
|
||||||
|
|
13
ld/ChangeLog
13
ld/ChangeLog
|
@ -1,3 +1,16 @@
|
||||||
|
2010-09-16 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* ld.texinfo (NOLOAD): Do not erroneously state that contents will
|
||||||
|
appear in output file.
|
||||||
|
* ldlang.c (lang_add_section): Clear SEC_HAS_CONTENTS on noload
|
||||||
|
unless SEC_COFF_SHARED_LIBRARY.
|
||||||
|
(map_input_to_output_sections): Don't set SEC_HAS_CONTENTS for noload
|
||||||
|
output sections.
|
||||||
|
(lang_size_sections_1): Don't test SEC_NEVER_LOAD when deciding
|
||||||
|
to update dot in region. Ditto when setting SEC_ALLOC if dot
|
||||||
|
advanced due to assignment.
|
||||||
|
* ldwrite.c (build_link_order): Don't test SEC_NEVER_LOAD.
|
||||||
|
|
||||||
2010-09-15 Kai Tietz <kai.tietz@onevision.com>
|
2010-09-15 Kai Tietz <kai.tietz@onevision.com>
|
||||||
|
|
||||||
* scripttempl/pep.sc: Add .xdata segment and
|
* scripttempl/pep.sc: Add .xdata segment and
|
||||||
|
|
|
@ -4290,8 +4290,7 @@ The linker normally sets the attributes of an output section based on
|
||||||
the input sections which map into it. You can override this by using
|
the input sections which map into it. You can override this by using
|
||||||
the section type. For example, in the script sample below, the
|
the section type. For example, in the script sample below, the
|
||||||
@samp{ROM} section is addressed at memory location @samp{0} and does not
|
@samp{ROM} section is addressed at memory location @samp{0} and does not
|
||||||
need to be loaded when the program is run. The contents of the
|
need to be loaded when the program is run.
|
||||||
@samp{ROM} section will appear in the linker output file as usual.
|
|
||||||
@smallexample
|
@smallexample
|
||||||
@group
|
@group
|
||||||
SECTIONS @{
|
SECTIONS @{
|
||||||
|
|
21
ld/ldlang.c
21
ld/ldlang.c
|
@ -2245,6 +2245,8 @@ lang_add_section (lang_statement_list_type *ptr,
|
||||||
case noload_section:
|
case noload_section:
|
||||||
flags &= ~SEC_LOAD;
|
flags &= ~SEC_LOAD;
|
||||||
flags |= SEC_NEVER_LOAD;
|
flags |= SEC_NEVER_LOAD;
|
||||||
|
if ((flags & SEC_COFF_SHARED_LIBRARY) == 0)
|
||||||
|
flags &= ~SEC_HAS_CONTENTS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3479,8 +3481,8 @@ map_input_to_output_sections
|
||||||
/* Make sure that any sections mentioned in the expression
|
/* Make sure that any sections mentioned in the expression
|
||||||
are initialized. */
|
are initialized. */
|
||||||
exp_init_os (s->data_statement.exp);
|
exp_init_os (s->data_statement.exp);
|
||||||
/* The output section gets CONTENTS, and usually ALLOC and
|
/* The output section gets CONTENTS, ALLOC and LOAD, but
|
||||||
LOAD, but the latter two may be overridden by the script. */
|
these may be overridden by the script. */
|
||||||
flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD;
|
flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD;
|
||||||
switch (os->sectype)
|
switch (os->sectype)
|
||||||
{
|
{
|
||||||
|
@ -3491,7 +3493,7 @@ map_input_to_output_sections
|
||||||
flags = SEC_HAS_CONTENTS;
|
flags = SEC_HAS_CONTENTS;
|
||||||
break;
|
break;
|
||||||
case noload_section:
|
case noload_section:
|
||||||
flags = SEC_HAS_CONTENTS | SEC_NEVER_LOAD;
|
flags = SEC_NEVER_LOAD;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (os->bfd_section == NULL)
|
if (os->bfd_section == NULL)
|
||||||
|
@ -4979,14 +4981,9 @@ lang_size_sections_1
|
||||||
/* Update dot in the region ?
|
/* Update dot in the region ?
|
||||||
We only do this if the section is going to be allocated,
|
We only do this if the section is going to be allocated,
|
||||||
since unallocated sections do not contribute to the region's
|
since unallocated sections do not contribute to the region's
|
||||||
overall size in memory.
|
overall size in memory. */
|
||||||
|
|
||||||
If the SEC_NEVER_LOAD bit is not set, it will affect the
|
|
||||||
addresses of sections after it. We have to update
|
|
||||||
dot. */
|
|
||||||
if (os->region != NULL
|
if (os->region != NULL
|
||||||
&& ((os->bfd_section->flags & SEC_NEVER_LOAD) == 0
|
&& (os->bfd_section->flags & (SEC_ALLOC | SEC_LOAD)))
|
||||||
|| (os->bfd_section->flags & (SEC_ALLOC | SEC_LOAD))))
|
|
||||||
{
|
{
|
||||||
os->region->current = dot;
|
os->region->current = dot;
|
||||||
|
|
||||||
|
@ -5172,8 +5169,8 @@ lang_size_sections_1
|
||||||
/* If dot is advanced, this implies that the section
|
/* If dot is advanced, this implies that the section
|
||||||
should have space allocated to it, unless the
|
should have space allocated to it, unless the
|
||||||
user has explicitly stated that the section
|
user has explicitly stated that the section
|
||||||
should never be loaded. */
|
should not be allocated. */
|
||||||
if (!(output_section_statement->flags & SEC_NEVER_LOAD))
|
if (output_section_statement->sectype != noalloc_section)
|
||||||
output_section_statement->bfd_section->flags |= SEC_ALLOC;
|
output_section_statement->bfd_section->flags |= SEC_ALLOC;
|
||||||
}
|
}
|
||||||
dot = newdot;
|
dot = newdot;
|
||||||
|
|
|
@ -276,10 +276,9 @@ build_link_order (lang_statement_union_type *statement)
|
||||||
output_section = statement->padding_statement.output_section;
|
output_section = statement->padding_statement.output_section;
|
||||||
ASSERT (statement->padding_statement.output_section->owner
|
ASSERT (statement->padding_statement.output_section->owner
|
||||||
== link_info.output_bfd);
|
== link_info.output_bfd);
|
||||||
if (((output_section->flags & SEC_HAS_CONTENTS) != 0
|
if ((output_section->flags & SEC_HAS_CONTENTS) != 0
|
||||||
|| ((output_section->flags & SEC_LOAD) != 0
|
|| ((output_section->flags & SEC_LOAD) != 0
|
||||||
&& (output_section->flags & SEC_THREAD_LOCAL)))
|
&& (output_section->flags & SEC_THREAD_LOCAL)))
|
||||||
&& (output_section->flags & SEC_NEVER_LOAD) == 0)
|
|
||||||
{
|
{
|
||||||
link_order = bfd_new_link_order (link_info.output_bfd,
|
link_order = bfd_new_link_order (link_info.output_bfd,
|
||||||
output_section);
|
output_section);
|
||||||
|
|
Loading…
Reference in New Issue