Displaying 20 results from an estimated 400 matches similar to: "[LLVMdev] Compiling a raw binary with llvm/clang"
2009 Dec 17
0
[LLVMdev] Compiling a raw binary with llvm/clang
On 2009-12-17 22:08, LiteHacker wrote:
> Hey,
>
> The following code creates a raw binary (no ELF or PE.. just raw):
>
> gcc -nostartfiles -c -o hello.o hello.c
> ld -o hello1 hello.o --oformat binary
>
> You can try the following code out with it:
>
> void _start()
> {
> while(1);
> }
>
> The resulting raw binary is 5 bytes.
>
It is 2.1M here
2009 Dec 17
3
[LLVMdev] Compiling a raw binary with llvm/clang
Indeed ld does link it. The reason I am using llvm-ld, is for its unique
functionality.
I intend to link to object files together (created by cling), and link them
with llvm-ld.
The main feature that I am currently interested in is the ability to have
"inline functions" between two object files. This was basically impossible
with gcc.
Is there any way to make the raw binary with llvm?
2009 Dec 18
1
[LLVMdev] Compiling a raw binary with llvm/clang
$ clang -ffunction-sections -fdata-sections -Os -nostartfiles -c -o hello.o
hello.c
$ clang -ffunction-sections -fdata-sections -Os -nostartfiles -c -o test.o
test.c
$ llvm-ld -s -o hello2 hello.o
$ llc hello2.bc -o hello3
$ ld -o hello_B hello3 --oformat binary
ld:hello3: file format not recognized; treating as linker script
ld:hello3:1: syntax error
I am guessing that is what you meant by the
2009 Dec 17
0
[LLVMdev] Compiling a raw binary with llvm/clang
On Thu, Dec 17, 2009 at 1:00 PM, LiteHacker <vilmer88 at gmail.com> wrote:
>
> Indeed ld does link it. The reason I am using llvm-ld, is for its unique
> functionality.
> I intend to link to object files together (created by cling), and link them
> with llvm-ld.
> The main feature that I am currently interested in is the ability to have
> "inline functions"
2015 Feb 26
1
[PATCH] builder: handle -v and -x flags like in other tools (RHBZ#1196100)
Make sure that -x enables tracing and -v enables verbose mode, just like
other tools do.
Kind of followup of commit b6b9b90dd74c7b9204bdf218aa9360e117308e78.
---
builder/builder.ml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/builder/builder.ml b/builder/builder.ml
index a519913..0ddf076 100644
--- a/builder/builder.ml
+++ b/builder/builder.ml
@@ -555,7 +555,8 @@ let
2016 Aug 18
3
Should lld support binary output ("--oformat binary")?
One remaining blocking issue for linking FreeBSD with lld is the
inability to build the bootloader components. We have a patch[1] in
review to address one of the problems by switching to using a linker
script instead of GNU ld's -N option. Another issue is that some
bootloader components are created by the linker directly as binary
objects, using --oformat binary. (Other bootloader components
2018 Jul 25
2
LLD COFF library: crashes when lld::coff::link is called twice
If you call lld::coff::link twice, the second time gives this backtrace:
msvcp140d.dll!00007ffc35830806() Unknown
> zig.exe!std::_Debug_pointer<lld::coff::Chunk * __ptr64
const>(lld::coff::Chunk * const * _Ptr, const wchar_t * _File, unsigned int
_Line) Line 926 C++
zig.exe!std::_Debug_range2<lld::coff::Chunk * __ptr64 const *
__ptr64>(lld::coff::Chunk * const *
2018 Aug 08
2
LLD COFF library: crashes when lld::coff::link is called twice
+Rui and Peter
On Wed, Jul 25, 2018 at 8:34 AM, Andrew Kelley via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Here's a fix:
>
> --- a/lld/COFF/Driver.cpp
> +++ b/lld/COFF/Driver.cpp
> @@ -72,6 +72,9 @@ bool link(ArrayRef<const char *> Args, bool CanExitEarly,
> raw_ostream &Diag) {
> exitLld(errorCount() ? 1 : 0);
>
> freeArena();
> +
2007 Nov 12
5
Solaris build fix breaks Solaris
16396:055d98aa2dd0 almost works but not quite. LDFLAGS_DIRECT means we
end up with:
gld -melf_i386 -nostdlib -N -Ttext 0x100000 -o hvmloader.tmp hvmloader.o mp_tables.o util.o smbios.o 32bitbios_support.o acpi/acpi.a
Specifying a linker script and asking for -nostdlib is obviously
contradictory. Removing $(LDFLAGS_DIRECT) fixes the problem.
regards
john
2005 Jan 05
2
Comiple fails for Xen 2.0.2
Changes in xen/arch/x86/domain.c in 2.0.2 break comiple for me with:
ld --oformat elf32-i386 -T x86_32/xen.lds -N \
boot/x86_32.o /home/root/xen-2.0/xen/common/common.o
/home/root/xen-2.0/xen/drivers/char/driver.o
/home/root/xen-2.0/xen/drivers/acpi/driver.o
/home/root/xen-2.0/xen/drivers/pci/driver.o
/home/root/xen-2.0/xen/arch/x86/arch.o -o
/home/root/xen-2.0/xen/xen-syms
2016 May 13
2
How to debug if LTO generate wrong code?
Hello,
I'm enabling clang LTO to improve code size of Uefi standard (http://www.uefi.org/) firmware (https://github.com/tianocore/edk2), which is mostly C code. My project is in https://github.com/shijunjing/edk2 branch llvm : https://github.com/shijunjing/edk2/tree/llvm. I find my most firmware modules work well after enable LTO, but some X64 modules will not run (e.g. hang with CPU
2019 Jan 28
4
lld write wrong symbol value in .data section if enable -pie
Hi Rui,
I still fail to enable the lld in my Uefi firmware build to replace ld, and I found it is related to the wrong symbol values in the .data section, which are pointed by R_X86_64_64 relocation entries. I need your advices.
My firmware uses a linker script https://github.com/tianocore/edk2/blob/master/BaseTools/Scripts/GccBase.lds to do the linking. We use position independent code with
2019 Jan 29
3
lld write wrong symbol value in .data section if enable -pie
Hi Rui,
> but why don't you use lld-link (lld for Windows target) instead of ld.lld (lld for Unix target) to create UEFI applications?
I need support both PE/COFF and ELF format tools. I’m also working on the lld-link enabling (clang-cl + lld-link) in both Linux and windows. The ld.lld enabling (clang + ld.lld) is for ELF format native users. E.g.
2015 Nov 10
1
[PATCH] OCaml tools: use open_guestfs everywhere
Instead of creating Guestfs handles and manually apply common options
(e.g. debug and trace), use the open_guestfs in Common_utils.
This also applies the common options to handles which didn't set them
before, so we can inspect also their messages if needed.
---
builder/builder.ml | 8 ++------
customize/customize_main.ml | 4 +---
dib/dib.ml | 4 +---
2018 Jun 05
2
lld mishandling R_X86_64_PC32 relocations
Hi,
I've tracked down what I believe is a bug in lld's relocation processing for R_X86_64_PC32 REL relocations.
I'm producing the object file in a slightly unusual way: I'm using objcopy on a relocatable i386 ELF object file to convert it to x86_64 which transforms a R_386_PC32 into a R_X86_64_PC32.
Steps to reproduce:
1. Assemble the attached bug.asm using nasm and note the
2019 Jan 29
2
lld write wrong symbol value in .data section if enable -pie
Hi Rui,
A quick question: Does lld-link only work with clang-cl with windows-msvc option? Can lld-link work with clang with linux-gnu option?
Thanks
Steven Shi
Intel\SSG\FID\Firmware Infrastructure
From: Shi, Steven
Sent: Tuesday, January 29, 2019 1:32 PM
To: 'Rui Ueyama' <ruiu at google.com>
Cc: llvm-dev at lists.llvm.org
Subject: RE: lld write wrong symbol value in .data
2019 Mar 25
2
Trying to create a pure LLVM toolchain on musl based distribution
Le 25/03/2019 à 14:41, Peter Smith a écrit :
> Hello David,
>
> I don't know much about the specifics of Musl, so I'm responding generally.
>
> As I understand it, clang expects to find the compiler-rt libraries
> relative to the resource directory, which you can find out the
> location of with clang --print-resource-dir . By default it is
> lib/clang/9.0.0
2020 Mar 27
3
llvm-objdump cannot recognize mul&mulh RISC-V M Instructions
I am using llvm-project compiling risc-v programs.
llvm-project version:dd8a2013dc1804be1b7d9cffacad2e984300bd22
Instructons to build LLVM+clang:
```
cmake -G Ninja
-DCMAKE_INSTALL_PREFIX=/home/llvm/workspace/llvm/llvm-project/llvm_install
-DCMAKE_BUILD_TYPE="Release"
-DDEFAULT_SYSROOT="/home/llvm/workspace/riscv/riscv-tc-20200220/bin/riscv32-unknown-elf"
2008 Feb 20
3
OSX universal rsync
Hi All,
Well, we compiled pre9 on an intel Mac running Tiger and now it
does work on the machine. I need to see if that will now work on a PPC
mac though. Hopefully it will but I am wondering if there is a way to
compile and make a universal binary rsync for the Mac that will run on
both, from my PPC Mac. Itried that yesterday with
patch -p1 <patches/flags.diff
patch -p1
2008 Mar 05
2
[LLVMdev] Error messages in llvm-test
Hi all,
llvm-test fails on me in the first test (and many subsequent tests, but
I hope that fixing the first test will allow me to continue).
I see syntax errors from the C compiler and core dumps from llc.
Is any of this supposed to happen?
This is still on my amd64 machine. However, the build process is using
the right incantation to compile (gcc-4.2 -m32 -Wl,-melf_i386).
The llvm-gcc