Skip to content
This repository was archived by the owner on Dec 9, 2018. It is now read-only.
This repository was archived by the owner on Dec 9, 2018. It is now read-only.

Using lld as the linker #5

@japaric

Description

@japaric
$ xargo rustc --target x86_64 --release -- -C linker=false
$ ld.lld target/x86_64/release/kernel.0.o -o target/x86_64/release/kernel

Works and it doesn't implicitly link to libc or crt*.o like gcc does. But, because we didn't pass a linker script, the output binary doesn't have the right memory layout.

The problem is that lld doesn't support linker scripts as well as gcc/ld. In particular it doesn't support variables (e.g. header_start = .) or expressions (e.g. LONG(0)), though it does support "offsets" like . = 0x100000. This makes it impossible to implement the multiboot header in a linker script.

Update: Check the lld branch for more details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions