<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Tim,<br>
<blockquote
cite="mid:CAFHTzf+0bPPxYej3hBitdyr08pWOjna4AtifiCrOfWUPpnCx2A@mail.gmail.com"
type="cite">
<blockquote type="cite">
<pre wrap="">The way to test would be :-
lld -flavor gnu -target [x86_64|hexagon|x86] ....
</pre>
</blockquote>
<pre wrap="">
This was what gave me the linker script error, if I'm interpreting you
correctly:
$ cat simple.s
.text
.global _start
.type _start,@function
_start:
callq bar
ret
$ clang simple.s -c- -o- \
| lld -flavor gnu -target x86_64 emit-yaml -r - \
| lld -flavor gnu -target x86_64 -
Failed to read file: -: Error parsing linker script
Everything except that last command is just to get an obviously
correct YAML file containing (in this case) an R_X86_64_PC32. The idea
is to make sure that last command can parse "R_X86_64_PC32" as a
string and knows what to do with it, at least as far as constructing
an internal representation.
</pre>
</blockquote>
The problem that you are seeing here is because of
ELFTargetInfo::parseFile interpreting the input file as a script. <br>
<br>
ELFTargetInfo, parses the input file using the following<br>
<br>
- If the input contains a ELF magic, treat it as ELF file<br>
- If the input ends in extension <b>objtxt</b>, treat it as YAML<br>
- otherwise treat it as linker script<br>
<br>
In your case the input is being treated as a linker script as, stdin
based yaml support doesnot exist.<br>
<br>
Can you convert the file to .objtxt and use that in the command
line.<br>
<br>
<blockquote
cite="mid:CAFHTzf+0bPPxYej3hBitdyr08pWOjna4AtifiCrOfWUPpnCx2A@mail.gmail.com"
type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">For your case you need to handle aarch64 seperately (see lld-core.cpp).
</pre>
</blockquote>
<pre wrap="">
To me it looks like Nick Kledzik's refactoring last month made
lld-core dead code. It's not added in CMakeLists.txt any more.
The replacement (lib/Driver/CoreDriver.cpp) appears to be completely
target-agnostic. Is that likely just because no-one has got around to
adding target-specific intelligence to it yet, or is it a design
decision?
</pre>
</blockquote>
Ah sorry about the wrong comment. The code changes that you would
need to refer would be <br>
in function ELFTargetInfo::create in file
lib/ReaderWriter/ELF/ELFTargetInfo.cpp<br>
<br>
Thanks<br>
<br>
Shankar Easwaran<br>
<pre class="moz-signature" cols="72">--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation</pre>
</body>
</html>