bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/11985] New: GOLD seg-faults if it cannot create needed output


From: nickc at redhat dot com
Subject: [Bug gold/11985] New: GOLD seg-faults if it cannot create needed output sections
Date: 6 Sep 2010 08:53:29 -0000

GOLD assumes that it will be able to find or create certain output sections, eg
.dynamic, ,dynstr, etc.  When it is unable to do so, a segmentation fault occurs
because of indirection via a NULL pointer.  For example:

  % gcc -c hello.c    [hello.c is a simple hello world type program]
  % cat discard.t
  SECTIONS { /DISCARD/ : { *(*) } }
  % gold -T discard.t hello.o -lc
  Segmentation fault (core dumped)

I realise that this scenario is unlikely to occur in the real world, but I do
feel that the linker should never just seg-fault.  I do not have a patch to fix
the problem because I am not sure what people feel is the correct way to handle
the problem.  Possibilities that occur to me are:

  * Issue an error message and refuse to link.
  * Issue a warning message, but continue trying to link.
  * Force the creation of the necessary output sections.

I originally ran across this problem creating a linker script to test the MEMORY
patch, where all was interested in was the appearance of certain sections in the
output binary.  I did not want, or need, any of the dynamic sections.

-- 
           Summary: GOLD seg-faults if it cannot create needed output
                    sections
           Product: binutils
           Version: 2.21 (HEAD)
            Status: NEW
          Severity: minor
          Priority: P2
         Component: gold
        AssignedTo: ian at airs dot com
        ReportedBy: nickc at redhat dot com
                CC: bug-binutils at gnu dot org
 GCC build triplet: any
  GCC host triplet: any
GCC target triplet: any


http://sourceware.org/bugzilla/show_bug.cgi?id=11985

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]