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

@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.

@partaror partaror force-pushed the MissingSectionsEndAssignEvalPartialLink branch from 4bf9855 to 8d0996b Compare January 5, 2026 13:16
@parth-07
Copy link
Contributor Author

parth-07 commented Jan 6, 2026

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.

This patch does not affect the evaluations of symbol assignments that are specified in the output section. The above example shared behaves as expected, that is, the value of u1 is 0x100 with and without this patch changes.

Please document this behavior.

Symbol assignment evaluation order should be the same for both the usual and the partial link. We have the symbol assignment
evaluation order docs: https://qualcomm.github.io/eld/documentation/linker_script.html#assignment-evaluation-order. This patch makes the partial linking assignment evaluation order to what the docs states.

@quic-seaswara quic-seaswara force-pushed the MissingSectionsEndAssignEvalPartialLink branch from 8d0996b to d20333c Compare January 7, 2026 22:05
@partaror partaror force-pushed the MissingSectionsEndAssignEvalPartialLink branch 2 times, most recently from 3819016 to 8c4ea35 Compare January 13, 2026 08:08
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 8c4ea35 to a695165 Compare January 14, 2026 07:06
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