2008-01-07  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/5522
	* elflink.c (elf_link_input_bfd): Don't write out a section if
	its output section is marked with SEC_NEVER_LOAD.

ld/testsuite/

2008-01-07  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/5522
	* ld-elf/noload-3.d: New file.
	* ld-elf/noload-3.s: Likewise.
	* ld-elf/noload-3.t: Likewise.
This commit is contained in:
H.J. Lu 2008-01-07 16:45:35 +00:00
parent a7c02bc8e1
commit ace7938838
7 changed files with 1239 additions and 1197 deletions

View File

@ -1,3 +1,9 @@
2008-01-07 H.J. Lu <hongjiu.lu@intel.com>
PR ld/5522
* elflink.c (elf_link_input_bfd): Don't write out a section if
its output section is marked with SEC_NEVER_LOAD.
For older changes see ChangeLog-2007
Local Variables:

View File

@ -9511,6 +9511,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
default:
{
if (! (o->flags & SEC_EXCLUDE)
&& ! (o->output_section->flags & SEC_NEVER_LOAD)
&& ! bfd_set_section_contents (output_bfd, o->output_section,
contents,
(file_ptr) o->output_offset,

File diff suppressed because it is too large Load Diff

1206
ld/testsuite/ChangeLog-2007 Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
#ld: -T noload-3.t
#objdump: -s -j .foo1
#...
Contents of section .foo1:
[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ [0-9a-f]+ [0-9a-f]+[ \t]+This is a test.*
#pass

View File

@ -0,0 +1,6 @@
.section .foo2,"aw",%progbits
.byte 1
.section .foo1,"w",%progbits
.string "This is a test."
.section .foo,"aw",%progbits
.space 16

View File

@ -0,0 +1,7 @@
SECTIONS
{
.foo2 : { *(.foo2) }
.foo1 : { *(.foo1) }
.foo (NOLOAD) : { *(.foo) }
/DISCARD/ : { *(*) }
}