Skip to content

Proposal: remove linkme #21

@AsakuraMizu

Description

@AsakuraMizu

linkme is a tool for collecting elements across crates during linking. We use it to maintain trap callbacks.

Why

However, there are currently the following issues:

  1. The trap callback slice we create using linkme will only have 0 or 1 items. It's somewhat overkill.

  2. It doesn't work well on bare metal (target_os = "none"), because bare metal applications typically require writing a linker script and then maintaining each used linkme section (linkme_XXX/linkm2_XXX), otherwise it will become Orphan Sections, and then be placed in a (potentially inappropriate) location by the linker.

Possible Alternatives

  1. Use crate_interface or similar methods to leverage weak symbols to define trap callbacks.
  2. Patch linkme and rename the generated symbols to .rodata.xxx, etc., which might solve the problem (unverified).

Metadata

Metadata

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions