Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add --init vectorAdd to README linking example #156 #155

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

wenhu1024
Copy link
Contributor

Linker Initialization Function

Added --init vectorAdd to explicitly specify the initialization function for the executable. Without this flag, the vectorAdd symbol was not visible in the symbol table when using llvm-readelf -s vecadd.riscv.

Key reasons for adding the flag:

  • Ensures the vectorAdd function is recognized in the executable's symbol table
  • Controls the program's initialization sequence
  • Guarantees the correct placement of the vectorAdd symbol during linking

Before adding --init:

  • llvm-readelf -s vecadd.riscv | grep vectorAdd showed no symbol

After adding --init vectorAdd:

  • The symbol appears with a valid address (0x800000b8)
  • Confirms successful symbol inclusion in the executable

@zhoujingya zhoujingya changed the title [VENTUS][README] add --init vectorAdd to README linking example fix: add --init vectorAdd to README linking example Dec 6, 2024
@zhoujingya zhoujingya changed the title fix: add --init vectorAdd to README linking example fix: add --init vectorAdd to README linking example#156 Dec 6, 2024
@zhoujingya zhoujingya changed the title fix: add --init vectorAdd to README linking example#156 fix: add --init vectorAdd to README linking example #156 Dec 6, 2024
@zhoujingya zhoujingya linked an issue Dec 6, 2024 that may be closed by this pull request
@zhoujingya
Copy link
Collaborator

Goog job!

@zhoujingya zhoujingya merged commit 248085f into THU-DSP-LAB:main Dec 6, 2024
2 checks passed
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.

Missing Symbol After Linking
2 participants