This is the mail archive of the binutils@sources.redhat.com 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]

Re: "Warning: size of symbol FOO changed from X to Y in OBJ"


"H . J . Lu" <hjl@lucon.org> writes:

> > Well, I don't know what that's about.  That's completely wrong.  If
> > BFD wants to report a fatal error, it should arrange to return false.
> > If BFD does not want to report a fatal error, it should not return
> > false.  It makes no sense for the linker to try to second guess BFD in
> > this regard.
> > 
> > According to the ChangeLog, H.J. added this:
> > 
> > 2001-02-26  H.J. Lu  <hjl@gnu.org>
> > 
> > 	* ldlang.c (open_input_bfds): Set the bfd error handler so
> >         that problems can be caught whilst loading symbols.
> >         (record_bfd_errors): New function: Report BFD errors and mark
> >         the executable output as being invalid.
> > 
> > Why?
> 
> That patch was made after some discussions with Nick for
> 
> http://sources.redhat.com/ml/binutils/2001-02/msg00508.html
> 
> I guess for some platform, warning during symbol loading may be fatal.

Yes, that is definitely true.  However, if BFD wants to report a fatal
error, it should arrange to return false.  Calling _bfd_error_handler
is not a mechanism for reporting a fatal error.

It's true that styp_to_sec_flags currently has no way to report error.
However, that is easily fixed.  Once that is done, it's easy to change
make_a_section_from_file to check for an error return and return false
if it finds one.

Having the linker look look for warning messages and treat them as
fatal makes no sense.  It's not even simpler than doing the right
thing.  It's the kind of thing you would do if you couldn't change the
source code.

Ian


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