qualcomm/eld

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

開放

#339 建立於 2025年8月18日

 (1 則留言) (0 個反應) (0 位負責人)C++ (73 個分叉)auto 404
gnu-incompatibilitygood first issue

倉庫指標

星標
 (254 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南