<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://sourceware.org/bugzilla/bugzilla.dtd">

<bugzilla version="4.0.10"
          urlbase="http://sourceware.org/bugzilla/"
          
          maintainer="overseers@sourceware.org"
>

    <bug>
          <bug_id>13232</bug_id>
          
          <creation_ts>2011-09-28 18:31:00 +0000</creation_ts>
          <short_desc>Regression: --gc-sections: local symbol `_dl_argv@@GLIBC_PRIVATE&apos; in ld.so is referenced by DSO</short_desc>
          <delta_ts>2011-09-28 18:35:55 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>binutils</product>
          <component>ld</component>
          <version>2.24 (HEAD)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>13195</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>13177</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jan Kratochvil">jan.kratochvil</reporter>
          <assigned_to name="Not yet assigned to anyone">unassigned</assigned_to>
          
          <cf_gcchost></cf_gcchost>
          <cf_gcctarget>x86_64-fedora16-linux-gnu</cf_gcctarget>
          <cf_gccbuild></cf_gccbuild>
          

      

      

      

          <long_desc isprivate="0">
            <commentid>50794</commentid>
            <who name="Jan Kratochvil">jan.kratochvil</who>
            <bug_when>2011-09-28 18:31:26 +0000</bug_when>
            <thetext>3475fe928892df696f6ea9b2c912e1379591e736 is the first bad commit

On Wed, 14 Sep 2011 21:14:38 +0200, H.J. Lu wrote:
&gt; 2011-09-14  H.J. Lu  &lt;hongjiu.lu@intel.com&gt;
&gt;
&gt;       PR ld/13177
&gt;       * elflink.c (elf_gc_sweep_symbol): Also hide symbols without PLT
&gt;       nor GOT references.

echo &apos;int main(void){return 0;}&apos;|gcc -o 1.o -c -Wall -x c -;gcc -v -o 1 1.o -Wall -Wl,--gc-sections

# OK but replace collect2 (old system BFD ld) with BFD HEAD ld:

.../ld/ld-new --build-id --no-add-needed --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o 1 /usr/lib/gcc/x86_64-redhat-linux/4.6.1/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.6.1/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.6.1/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/4.6.1 -L/usr/lib/gcc/x86_64-redhat-linux/4.6.1/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.6.1/../../.. 1.o --gc-sections -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/4.6.1/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.6.1/../../../../lib64/crtn.o

ld-new: 1: local symbol `_dl_argv@@GLIBC_PRIVATE&apos; in /lib64/ld-linux-x86-64.so.2 is referenced by DSO
ld-new: final link failed: Bad value

Tested on fedora-16-x86_64.  gold works OK.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>50795</commentid>
            <who name="H.J. Lu">hjl.tools</who>
            <bug_when>2011-09-28 18:35:55 +0000</bug_when>
            <thetext>Dup.

*** This bug has been marked as a duplicate of bug 13195 ***</thetext>
          </long_desc>
      
      

    </bug>

</bugzilla>