-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Try __libc_
section prefix
#45
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macOS: no change.
---- declaration::test_functions stdout ----
thread 'declaration::test_functions' panicked at 'assertion failed: !FUNCTIONS.is_empty()', tests/custom_linkme_path.rs:21:9
---- declaration::test_slice stdout ----
thread 'declaration::test_slice' panicked at 'assertion failed: !SLICE.is_empty()', tests/custom_linkme_path.rs:12:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Cortex-M:
error: linking with `rust-lld` failed: exit status: 1
|
= note: "rust-lld" "-flavor" "gnu" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/cortex_m_linkme_test-16abada556882b6c.cortex_m_linkme_test.11f206d2-cgu.0.rcgu.o" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/cortex_m_linkme_test-16abada556882b6c.cortex_m_linkme_test.11f206d2-cgu.1.rcgu.o" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/cortex_m_linkme_test-16abada556882b6c.cortex_m_linkme_test.11f206d2-cgu.2.rcgu.o" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/cortex_m_linkme_test-16abada556882b6c.cortex_m_linkme_test.11f206d2-cgu.3.rcgu.o" "--as-needed" "-L" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps" "-L" "/home/runner/work/linkme/linkme/target/release/deps" "-L" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/build/cortex-m-linkme-test-fd2f9025fa6ab5f3/out" "-L" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/build/cortex-m-dc8ce5e5692e1185/out" "-L" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/build/cortex-m-rt-146748f53fc7675e/out" "-L" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/build/cortex-m-semihosting-06c5e7e29f999ff6/out" "-L" "/usr/share/rust/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib" "-Bstatic" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/liblinkme-f7db9041ae6efe5a.rlib" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/libcortex_m_rt-66869b94f8d0a046.rlib" "--start-group" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/libpanic_semihosting-23f6673becf7b019.rlib" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/libcortex_m_semihosting-d41a19e13b83fd58.rlib" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/libcortex_m-d0a9c8248f754074.rlib" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/libembedded_hal-d3d0fba186ae51c5.rlib" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/libvoid-9ff3a42907c50f26.rlib" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/libnb-a64e30147a73fe33.rlib" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/libnb-722d2d7ea921a817.rlib" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/libvolatile_register-8f58f7ecc06a6493.rlib" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/libvcell-bf2fa04b84d99d34.rlib" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/libbare_metal-943465c25f42e4e6.rlib" "/usr/share/rust/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib/librustc_std_workspace_core-ba626387a2e50982.rlib" "/usr/share/rust/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib/libcore-bc639632082e340c.rlib" "--end-group" "/usr/share/rust/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib/libcompiler_builtins-4ec3ed03bf6f473e.rlib" "-Bdynamic" "--eh-frame-hdr" "-znoexecstack" "-L" "/usr/share/rust/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib" "-o" "/home/runner/work/linkme/linkme/target/thumbv7m-none-eabi/release/deps/cortex_m_linkme_test-16abada556882b6c" "--gc-sections" "-O1" "-Tlink.x"
= note: rust-lld: error: no memory region specified for section '__libc_SHENANIGANS'
rust-lld: error: no memory region specified for section '__libc_EMPTY'
It would make sense that macOS would be unchanged, as the code I linked in #41 (comment) is in the You can actually see the different generated code fairly easily in the compiler explorer: https://godbolt.org/z/4sTrKzxYn. When building with rustc 1.55.0, there is a I believe the original motivation for switching to In contrast, I don't see any change in the generated assembly for |
Per #41 (comment). Recent versions of lld recognize section names with a
__libc_
prefix as being retained even without rustc support forllvm.used
.Relevant to #41 and #40. Sadly as far as I can tell I don't think this fully fixes either one.