tock / tock/elf2tab

Allow setting non-default padding

Open
#100 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
18
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Currently the padding is set solely based on the architecture assumptions:
https://github.com/tock/elf2tab/blob/06b05fdad764c59c279a50686ccd512f544fb824/src/convert.rs#L192-L204

However these assumptions are not always correct. For instance, in case of RISC-V, the MPU (PMP) might have greater alignment requirements (see https://github.com/tock/tock/issues/4417). This can be kind of worked around by adding something like

    .dummy : {
        . = ALIGN(4096); /* For 4096 granularity */
    } > FLASH

but it also breaks as elf2tbf adds at least 4 bytes for relocation data to the total size.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/convert.rs at lines 192-204, where padding is derived from architecture assumptions, and trace how that value contributes to the ELF-to-bundle size. Review the linker-script workaround described in the issue and define how a non-default alignment could be supplied. Done means the requested padding is configurable and the resulting bundle size includes all generated data.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, embedded-iot
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.