[GNUIncompatibility] eld errors out if a memory region is not assigned to an output section
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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