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

#[start] doesn't work with cdylib #59350

Open
wangbj opened this issue Mar 21, 2019 · 1 comment
Open

#[start] doesn't work with cdylib #59350

wangbj opened this issue Mar 21, 2019 · 1 comment
Labels
A-linkage Area: linking into static, shared libraries and binaries

Comments

@wangbj
Copy link

wangbj commented Mar 21, 2019

It is useful to pass -Wl,-e_<entry> to the linker, even for shared libraries, it doesn't seem like #[start] can change cdylib entry address, if this is intended, is there anyway to change entry address for cdylib?

@jonas-schievink jonas-schievink added the A-linkage Area: linking into static, shared libraries and binaries label Mar 21, 2019
@bjorn3
Copy link
Member

bjorn3 commented Jul 13, 2023

#[start] only affects which function will be called by the auto generated main function for executables. Using it to pass -Wl,-e_<entry> is wrong as that skips the initialization code of libc. You can pass -Clink-arg=-Wl,-e_<entry> to rustc when compiling if you want to pass this to the linker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries
Projects
None yet
Development

No branches or pull requests

3 participants