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] Make obj_sec_set_private_data into a format_ops member


On 02 May 2006 03:15, Alan Modra wrote:

> On Sun, Apr 30, 2006 at 08:50:29PM +0100, Dave Korn wrote:
>>   Currently, obj_sec_set_private_data is an object-dependent #define,
>> called in subseg_get, and used solely by the elf object format outputter
>> to get the ELF bfd new section hook called at the appropriate time.  It is
>> defined in obj-elf.h, which begins with this comment:
> 
> See http://sources.redhat.com/ml/binutils/2003-07/msg00502.html
> I'm going to fix this properly.


  In non-multi-obj builds, all ELF targets call the bfd new section hook, and
all non-ELF targets do not do so.  In multi-obj, all targets call the bfd new
section hook regardless.  This is a discrepancy which should be resolved, and
I suggest that the way to resolve it is by making multi-obj do the same as the
individual non-multi-obj targetted builds would do, which is to call the bfd
new section hook only for ELF format objects and not for non-ELF format
objects.  It's certainly not necessary to call the hook for those other
formats, and indeed is not just superfluous but can also be actually
incorrect; for instance it leads to a null pointer dereference on cygwin.

  My patch preserves existing behaviour in non-multi-obj, fixes incorrect
behaviour in all non-elf multi-obj output, addresses a blocking issue in
getting cygwin multi-obj to work, and makes no odds to any future patch you
intend to produce in this area.  One of my crossbuilds failed and is currently
rerunning but the rest all produced no changes in the testsuite.  (BTW,
perhaps I should add an aout target to the set of crosses?)  I am also
proposing to submit further patches (either individually or en masse) that
would address the following non-multi-obj compatible macros which are
referenced in symbols.c:-

#ifdef obj_frob_label
  obj_frob_label (symbolP);
#endif

#ifdef obj_symbol_clone_hook
  obj_symbol_clone_hook (newsymP, orgsymP);
#endif

#ifdef obj_set_weak_hook
  obj_set_weak_hook (s);
#endif

#ifdef obj_clear_weak_hook
	  obj_clear_weak_hook (s);
#endif

..each of which AFAICT represents an undesirable interdependency between
symbol handling and object format that breaks multi-obj.

  What are your plans in this area?  Can I really not go ahead with these
patches without it interfering with your work?  It makes no difference to me
if I check it in one day and you completely replace it all with whatever
you've been putting together the next, but I would like to make progress with
--enable-targets=all for cygwin and even once the build errors relating to the
pe-coff weak name prefix variable are addressed, there are testsuite
regressions caused by crashes without this patch.  I've done my best to make
it as neutral and conservative as possible, there's no major refactoring going
on; are you sure you object?


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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