rust-embedded / rust-embedded/cortex-m

no code (no .text segment) when forgetting "-C", "link-arg=-Tlink.x" but no warning/error either

Open
#471 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1k
Forks
202
Avg merge
6d 2h
Merged PRs (30d)
2

Description

Hi,

I realize this is not really a bug, I just hoped to get some feedback about where you think this should be reported. The issue is that if you take this template and remove the "-C", "link-arg=-Tlink.x" line from .cargo/config (for instance, by reading this as a reference and copying bits into another project) then everything compiles just fine but the resulting binary is useless.

Here is the output of arm-none-eabi-objdump -h (I called the project devicers):

target/thumbv7em-none-eabihf/debug/devicers2:     file format elf32-littlearm

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .debug_abbrev 00001796  00000000  00000000  00000054  2**0
                  CONTENTS, READONLY, DEBUGGING, OCTETS
  1 .debug_info   000279ed  00000000  00000000  000017ea  2**0
                  CONTENTS, READONLY, DEBUGGING, OCTETS
  2 .debug_aranges 00002460  00000000  00000000  000291d7  2**0
                  CONTENTS, READONLY, DEBUGGING, OCTETS
  3 .debug_str    000427b6  00000000  00000000  0002b637  2**0
                  CONTENTS, READONLY, DEBUGGING, OCTETS
  4 .debug_pubnames 00016c70  00000000  00000000  0006dded  2**0
                  CONTENTS, READONLY, DEBUGGING, OCTETS
  5 .debug_pubtypes 0000114e  00000000  00000000  00084a5d  2**0
                  CONTENTS, READONLY, DEBUGGING, OCTETS
  6 .ARM.attributes 0000003a  00000000  00000000  00085bab  2**0
                  CONTENTS, READONLY
  7 .debug_frame  00007100  00000000  00000000  00085be8  2**2
                  CONTENTS, READONLY, DEBUGGING, OCTETS
  8 .debug_line   00026f57  00000000  00000000  0008cce8  2**0
                  CONTENTS, READONLY, DEBUGGING, OCTETS
  9 .debug_ranges 0001ac38  00000000  00000000  000b3c3f  2**0
                  CONTENTS, READONLY, DEBUGGING, OCTETS
 10 .debug_loc    0000006d  00000000  00000000  000ce877  2**0
                  CONTENTS, READONLY, DEBUGGING, OCTETS
 11 .comment      00000013  00000000  00000000  000ce8e4  2**0
                  CONTENTS, READONLY

I'm just trying to get some feedback here if this sounds to anybody like an issue worthy of fixing, the issue being that there was no complaint at any point suggesting anything was wrong, only by trying to execute the resulting binary (in my case trying to run it with the cargo-call-stack tool) do you get an error.

Thanks,
Alon

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

Reproduce the issue by removing the "-C" and "link-arg=-Tlink.x" lines from .cargo/config, then inspect the resulting binary with arm-none-eabi-objdump -h. Compare the build and linker behavior with and without those settings, and determine what diagnostic or validation would clearly identify the unusable output.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.