qualcomm / qualcomm/eld

[GNUIncompatibility] eld errors out if a memory region is not assigned to an output section

Open
#339 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

gnu-incompatibility good first issue
Dominant language
C++
Stars
259
Forks
84
Avg merge
2d 14h
Merged PRs (30d)
72

Description

eld errors out if a memory region is not assigned to an output section, but bfd does not.

Reproducer:

#!/usr/bin/env bash

cat >1.c <<\EOF
int foo() { return 11; }
EOF

cat >script.t <<\EOF
MEMORY {
  RAM : ORIGIN = 0x1000, LENGTH = 0x1000
}

SECTIONS {
  .foo : { *(.text.foo) } >RAM
  .text : { *(.text*) }
}
EOF

LDs=("ld.eld -m elf64lriscv")
SFs=(eld)

clang -o 1.o -target riscv64 1.c -c 
for i in "${!SFs[@]}"; do
  ${LDs[$i]} -o 1.${SFs[$i]}.out 1.o -T script.t # eld errors out with 'No memory region assigned to section .text'
                                                                     # bfd links without any warning / error.
done

Contributor guide

Open the contributing guide

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 with the 1.c and script.t reproducer, then run the shown eld and bfd linker commands to compare their handling of the unassigned .text section. Trace the linker-script MEMORY and SECTIONS handling; done when eld matches bfd's behavior and the reproducer is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, shell
Domain
build-system, compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.