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

ENTRY linker script token is unknown #1405

Open
beyarkay opened this issue Jan 24, 2025 · 1 comment
Open

ENTRY linker script token is unknown #1405

beyarkay opened this issue Jan 24, 2025 · 1 comment

Comments

@beyarkay
Copy link

I'm trying to use mold for an ARM32 embedded project (so the gcc toolchain is necessarily out of date), and after removing references to the --cref flag which I'm not sure I need, I ran into this problem:

mold: fatal: /[...]/linker.ld:24: ENTRY(Reset_Handler)
                                  ^ unknown linker script token
collect2: error: ld returned 1 exit status
make: *** [/[...]/Makefile:985: /[...]/output.elf] Error 1

I looked around at other issues, and it seems like the mold linker does not intend to support the full linker script? Linking the project takes a long time at the moment, it would be great to use mold, but the ENTRY token is common for embedded applications. (ENTRY explainer)

Versions:

$ mold --version
mold 2.35.1 (3cb551424bfcfd41e0f21a821b45ded33d06a38b; compatible with GNU ld)

$ ./toolchain/gcc-arm-none-eabi/bin/arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ ./toolchain/gcc-arm-none-eabi/bin/arm-none-eabi-ld --version
GNU ld (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 2.33.1.20191025
Copyright (C) 2019 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
@rui314
Copy link
Owner

rui314 commented Jan 24, 2025

mold support a limited set of linker script commands. ENTRY is not supported, but you can use the -e command line option instead.

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

No branches or pull requests

2 participants