Skip to content

Support LLVM linked ELF RISC-V executable - #13197

Open
metarutaiga wants to merge 1 commit into
apache:masterfrom
metarutaiga:llvm-elf-riscv
Open

metarutaiga wants to merge 1 commit into
apache:masterfrom
metarutaiga:llvm-elf-riscv

Conversation

@metarutaiga

Copy link
Copy Markdown

Summary

I tried to use LLVM to build my executable, but it crashed always.
Then I found it did't implement some relocation.

Impact

Implement R_RISCV_BRANCH / R_RISCV_JAL / R_RISCV_RVC_JUMP / R_RISCV_RVC_BRANCH

Testing

#include <stdio.h>

int main(int argc, char const* argv[])
{
  printf("Hello world\n");
  return 0;
}
clang -Os --target=riscv32-esp-elf -march=rv32imc -mabi=ilp32 -Wl,-e,main,-r,-T,binfmt/libelf/gnu-elf.ld

@metarutaiga metarutaiga changed the title Support LLVM linked ELF executable Support LLVM linked ELF RISC-V executable Aug 27, 2024
acassis
acassis previously approved these changes Aug 27, 2024
@xiaoxiang781216

Copy link
Copy Markdown
Contributor

@metarutaiga please squash into one patch.

@jerpelea jerpelea left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update the title to
libs/libc: Support LLVM linked ELF RISC-V executable

add a commit message
and sign the commit

@acassis

acassis commented May 7, 2025 •

Copy link
Copy Markdown
Contributor

Hi @metarutaiga, nice to see you working on it again.

Please note that now all commits need to be signed (git commit -s)

* Name: _extract_bits
*
* Description:
* Copied from ELF_riscv.cpp (LLVM)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the description to explain what it does, you can keep this comment since ELF_riscv.cpp is licensed under Apache 2.0 as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants