Skip to content

Conversation

@parth-07
Copy link
Contributor

Until now, the linker was not evaluating output section end symbol assignments in partial links. This commit fixes this behavior.

Resolves #479

Until now, the linker was not evaluating output section end symbol
assignments in partial links. This commit fixes this behavior.

Resolves qualcomm#479

Signed-off-by: Parth Arora <partaror@qti.qualcomm.com>
@partaror partaror force-pushed the MissingSectionsEndAssignEvalPartialLink branch from a4eefc7 to 4bf9855 Compare November 24, 2025 15:05
@quic-seaswara
Copy link
Contributor

This is a good start but I am not sure about what is its effect on symbol values that are specified in the output section.

cat > 1.c <<  \!
int foo(float x) { return 0; }
!

cat > s.t << \!
SECTIONS {
  .foo : {
    *(.text.foo)
    u1 = 0x100;
  }
}
!

/usr/bin/clang -c 1.c -ffunction-sections -fno-asynchronous-unwind-tables
#eld
ld.eld -r 1.o -o r.o -T s.t
readelf -s r.o | grep u1
ld.eld r.o -o out.eld && readelf -s out.eld | grep u1
#bfd
ld.bfd -r 1.o -o r.o -T s.t
readelf -s r.o | grep u1
ld.bfd r.o -o out.bfd && readelf -s out.bfd | grep u1
#lld
ld.lld -r 1.o -o r.o -T s.t
readelf -s r.o | grep u1
ld.lld r.o -o out.lld && readelf -s out.lld | grep u1

Please document this behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linker script assignments are not evaluated for partial links

2 participants