This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: ELF_DYNAMIC_INTERPRETER


<?xml  version="1.0" ?><html>
<head>
<title></title>
</head>
<body>
<div align="left"><font face="Arial" color="#0000ff"><span style="font-size:10pt">&quot;Manoj Verma, Noida&quot; &lt;manojv@noida.hcltech.com&gt;</span></font><font face="Arial"><span 
style="font-size:10pt"> wrote:</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial" color="#0000ff"><span style="font-size:10pt">&gt; strings - myout | grep ld-linux &quot; gives</span></font></div>
<div align="left"><font face="Arial" color="#0000ff"><span style="font-size:10pt">&gt; </span></font></div>
<div align="left"><font face="Arial" color="#0000ff"><span style="font-size:10pt">&gt; /c/MinGW/msys/home/lib/ld-linux.so.2</span></font></div>
<div align="left"><font face="Arial" color="#0000ff"><span style="font-size:10pt">&gt; ld-linux.so.2</span></font></div>
<div align="left"><font face="Arial" color="#0000ff"><span style="font-size:10pt">&gt; </span></font></div>
<div align="left"><font face="Arial" color="#0000ff"><span style="font-size:10pt">&gt; &gt; &gt; If I give something like:</span></font></div>
<div align="left"><font face="Arial" color="#0000ff"><span style="font-size:10pt">&gt; &gt; &gt; $ arm-linux-ld test.o -dynamic-linker=/lib/ld-linux.so.2 -o myout</span></font></div>
<div align="left"><font face="Arial" color="#0000ff"><span style="font-size:10pt">&gt; &gt; &gt; and I do: </span></font></div>
<div align="left"><font face="Arial" color="#0000ff"><span style="font-size:10pt">&gt; &gt; &gt; $arm-linux-readelf -l myout </span></font></div>
<div align="left"><font face="Arial" color="#0000ff"><span style="font-size:10pt">&gt; &gt; &gt; i see:</span></font></div>
<div align="left"><font face="Arial" color="#0000ff"><span style="font-size:10pt">&gt; &gt; &gt;&#160;&#160;&#160;&#160;&#160;&#160; [Requesting program interpreter: </span></font></div>
<div align="left"><font face="Arial" color="#0000ff"><span style="font-size:10pt">&gt; &gt; /c/MinGW/msys/home/lib/ld-linux.so.2]</span></font></div>
<div align="left"><br/></div>
<div align="left"><font face="Arial"><span style="font-size:10pt"> If you run the 'ld' command on :</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">1.&#160;&#160; the plain vanilla CMD.EXE etc. from MS</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">2.&#160;&#160; the MSYS command shell</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">in Windoze, is there any difference?</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt"> When you use 'gcc' to link, it invokes 'ld' via 'spawn()' or something,</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">please see 'pexecute.c' in 'gcc-3.2.2/libiberty' (or whatever your GCC</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">sources were, I remember you mentioning 3.2.2). When you use 'ld'</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">directly, the command shell may interpret the given absolute pathname</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">in some wacky way, here the '</span></font><font face="Arial" color="#0000ff"><span style="font-size:10pt">/c/MinGW/msys/home' 
may be appended</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">by the MSYS shell... If so, you had better to discuss about this on the</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">MinGW or MSYS (if it has such) maillist, whether it is a bug or a</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">feature and if there are any means to disable the interpreting (if there</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">is such).</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt"> Anyway you can first see how 'arm-linux-gcc' invokes the linker by</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">using the '-v' option to 'arm-linux-gcc' (and saving the command with</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">a tee-pipe, '2&gt;logfile' or what the &quot;&gt; logfile 2&gt;&amp;1&quot; equivalent on Windoze</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">was...) and trying just the same command with just the same options, but</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">given from the shell command line...</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt"> Ok, my guess is that the MS 'CMD.EXE' handles the command ok</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">but the MSYS shell appends that extra stuff for some wacky reason.</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">I will also try a 'ld' command from the CMD.EXE here and will see</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">what happens... I haven't MSYS because my Windoze should behave</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">like a Windoze, my choice for a Unix-like system on PC is Linux, not</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">Windoze/MSYS or Windoze/Cygwin...</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">Cheers, Kai</span></font></div>
<div align="left"><br/>
</div>
<div align="left"></div>
</body>
</html>

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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