PATCH: PR 797: Alignment in empty section changes the output layout

Alan Modra amodra@bigpond.net.au
Fri May 6 06:20:00 GMT 2005


On Thu, May 05, 2005 at 09:02:23AM -0700, H. J. Lu wrote:
> With
> 
>   lang_size_sections (statement_list.head, abs_output_section,
>                       &statement_list.head, 0, 0, NULL,
>                       command_line.relax ? FALSE : TRUE);
>   lang_do_assignments (statement_list.head, abs_output_section, NULL,
> 0);
>   lang_reset_memory_regions ();
>   lang_mark_used_section ();
>   strip_unused_output_sections ();
> 
> at the end of strip_excluded_output_sections, I got
> failed: Bad value FAIL: PHDRS
> FAIL: PHDRS2

You need this from ppc64elf.em.

	  /* We must not cache anything from the preliminary sizing.  */
	  elf_tdata (output_bfd)->program_header_size = 0;

Perhaps a better approach would be to run a cut-down lang_do_assignments
that just keeps track of output section and symbol assignments other
than "." within output sections.  If it finds such an assignment, mark
the section as needed.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list