This is the mail archive of the binutils@sourceware.cygnus.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: 2.9.5.0.10 ld dumps core when /DISCARD/ is used


   Date: Fri, 03 Sep 1999 10:39:20 -0700
   From: Zack Weinberg <zack@bitmover.com>

   Ian Lance Taylor wrote:
   >    Date: Fri, 03 Sep 1999 09:29:41 -0700
   >    From: Zack Weinberg <zack@bitmover.com>
   > 
   >    I am using H.J.'s 2.9.5.0.10 binutils package.  Using /DISCARD/ in a
   >    ld script causes the linker to dump core when invoked.
   > 
   > Thanks for the bug report and test case.  Unfortunately, I can not
   > recreate it with the current development sources.  Perhaps the bug,
   > whatever it is, has been fixed.

   The bug seems to be input dependent - a simpler test case did not dump
   core.  I can attempt to track down the faulty code in my version if
   you like.

Sure, if you like.  I used the test case you sent earlier.  You can
also give me a test different case which I can use to reproduce the
problem.  Or you can try the development sources, from
    http://sourceware.cygnus.com/binutils/

   > Incidentally, a simpler way to do what you appear to be trying to do
   > is to use the --remove-section option of objcopy.

   If I could also rename sections with objcopy, that would be a viable
   option, but as far as I can tell you can't.  Also, when you delete a
   section with objcopy, symbols referenced only from that section are
   not removed from the symbol table.

If somebody sends me patches for renaming sections in objcopy, I'll
check them in.

Does the linker really behave differently with respect to symbols?

Fixing objcopy would presumably require some code in filter_symbols.
If the symbol is undefined, and some sections are being removed, and
BSF_KEEP is not set, then it's probably safe to discard the symbol.

Ian

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