This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

> > work correctly.
> > 
> 
> After 2005-05-05, elf_link_input_bfd calls _bfd_elf_link_output_relocs
> for all ELF targets on all output formats even if it isn't needed at
> all. Why should we do that?

Incorrect.

  emit_relocs = (finfo->info->relocatable
                 || finfo->info->emitrelocations);

Both calls from elf_link_input_bfd to elf_backend_emit_relocs are
guarded by emit_relocs.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]