PATCH: ld/2462: -Wl,-s always output unused bytes at the end

H. J. Lu hjl@lucon.org
Fri Mar 17 15:52:00 GMT 2006


On Fri, Mar 17, 2006 at 10:21:28AM -0500, Daniel Jacobowitz wrote:
> On Fri, Mar 17, 2006 at 07:15:59AM -0800, H. J. Lu wrote:
> > On Fri, Mar 17, 2006 at 10:05:33AM -0500, Daniel Jacobowitz wrote:
> > > On Fri, Mar 17, 2006 at 06:32:22AM -0800, H. J. Lu wrote:
> > > > Before your patch, _bfd_elf_link_output_relocs was called only for
> > > > relocatable files or finfo->info->emitrelocations is true. Now it
> > > > called on all ELF targets for all cases.
> > > 
> > > I had to spend twenty minutes going over your patch and the current and
> > > previous code in order to find where this happened.  If you'd just said
> > > something like "because of how emit_relocs is set in
> > > bfd_elf_final_link", maybe folks would have been able to understand
> > > what you were doing.
> > > 
> > > That means the patch is, by definition, not obvious.
> > > 
> > > After much mucking around, I think that just fixing the assignment to
> > > emit_relocs (by removing the check for elf_backend_emit_relocs) will
> > 
> > What did you mean? The current elf_link_input_bfd doesn't check
> > elf_backend_emit_relocs for emit_relocs.
> 
> bfd_elf_final_link does.
> 

Remove elf_backend_emit_relocs check in bfd_elf_final_link does
fix the problem on Linux. But it may break vxworks, which may have
to set info->emitrelocations.


H.J.



More information about the Binutils mailing list