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 02:18:24PM +0000, Paul Brook wrote:
> On Friday 17 March 2006 14:02, H. J. Lu wrote:
> > This is a regression caused by
> >
> > http://sourceware.org/ml/binutils/2005-05/msg00170.html
> >
> > If Paul has no problems with vxworks, I'd like to check it as an
> > obvious fix.
> 
> > 2006-03-17 ?H.J. Lu ?<hongjiu.lu@intel.com>
> >
> > ????????PR ld/2462
> > ????????* elflink.c (elf_emit_relocs): New.
> > ????????(elf_link_input_bfd): Emit relocations only when needed. Call
> > ????????elf_emit_relocs instead of bed->elf_backend_emit_relocs.
> >
> > ????????* elfxx-target.h (elf_backend_emit_relocs): Default to NULL.
> 
> I don't think this patch is even close to being "obvious".
> 

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. My patch changes it back to
what it was before your change for all targets, except for those which
define elf_backend_emit_relocs. For those targets, elf_backend_emit_relocs
will always be called. If a target expects to call
_bfd_elf_link_output_relocs unconditionally, it should define
elf_backend_emit_relocs.


H.J.


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