Bug 14465 - GOLD segfaults when linking with discarded .plt sections
Summary: GOLD segfaults when linking with discarded .plt sections
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-14 11:53 UTC by Nick Clifton
Modified: 2012-08-14 11:53 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clifton 2012-08-14 11:53:15 UTC
Discovered whilst creating a test for a different bug:

  % cat discard.t
  SECTIONS
  {
    .text : { *(.text) }
    /DISCARD/ : { *(*) }
  }

  % gold /usr/lib/crt1.o -L/usr/lib/gcc/i686-redhat-linux/4.7.0 -lc -T discard.t
  Segmentation fault

The problem appears to be that GOLD expects that the .plt and .rel.plt sections will both be present in the output file.

The test case is obviously nonsensical, but it is a cut down version of a much larger, and sensible, test case.