975f8a9e31
Giving linker script symbols defined outside of output sections a section-relative value early, leads to them being used in expressions as if they were defined inside an output section. This can mean loss of the section VMA, and wrong results. ld/ PR ld/18963 * ldexp.h (struct ldexp_control): Add rel_from_abs. (ldexp_finalize_syms): Declare. * ldexp.c (new_rel_from_abs): Keep absolute for expressions outside of output section statements. Set rel_from_abs. (make_abs, exp_fold_tree, exp_fold_tree_no_dot): Clear rel_from_abs. (struct definedness_hash_entry): Add final_sec, and comment. (update_definedness): Set final_sec. (set_sym_sections, ldexp_finalize_syms): New functions. * ldlang.c (lang_process): Call ldexp_finalize_syms. ld/testsuite PR ld/18963 * ld-scripts/pr18963.d, * ld-scripts/pr18963.t: New test. * ld-scripts/expr.exp: Run it. * ld-elf/provide-hidden-2.ld: Explicitly make "dot" absolute. * ld-mips-elf/gp-hidden.sd: Don't care about _gp section. * ld-mips-elf/no-shared-1-n32.d: Don't care about symbol shown at start of .data section. * ld-mips-elf/no-shared-1-n64.d: Likewise. * ld-mips-elf/no-shared-1-o32.d: Likewise. |
||
---|---|---|
.. | ||
align-with-input.d | ||
align-with-input.t | ||
align.exp | ||
align.s | ||
align.t | ||
align2.t | ||
align2a.d | ||
align2a.s | ||
align2b.d | ||
align2b.s | ||
align2c.d | ||
align2c.s | ||
alignof.exp | ||
alignof.s | ||
alignof.t | ||
assert.exp | ||
assert.s | ||
assert.t | ||
assert2.d | ||
assert2.t | ||
assign-loc.d | ||
assign-loc.t | ||
cross1.c | ||
cross1.t | ||
cross2.c | ||
cross2.t | ||
cross3.c | ||
cross3.t | ||
cross4.c | ||
crossref.exp | ||
data.d | ||
data.exp | ||
data.s | ||
data.t | ||
default-script.exp | ||
default-script.s | ||
default-script.t | ||
default-script1.d | ||
default-script2.d | ||
default-script3.d | ||
default-script4.d | ||
defined.exp | ||
defined.s | ||
defined.t | ||
defined2.d | ||
defined2.t | ||
defined3.d | ||
defined3.t | ||
defined4.d | ||
defined4.s | ||
defined4.t | ||
defined5.d | ||
defined5.s | ||
defined5.t | ||
defined6.d | ||
defined6.s | ||
defined6.t | ||
dynamic-sections-1.s | ||
dynamic-sections-2.s | ||
dynamic-sections.d | ||
dynamic-sections.exp | ||
dynamic-sections.t | ||
empty-address-1.d | ||
empty-address-1.s | ||
empty-address-1.t | ||
empty-address-2.s | ||
empty-address-2a.d | ||
empty-address-2a.t | ||
empty-address-2b.d | ||
empty-address-2b.t | ||
empty-address-3.s | ||
empty-address-3a.d | ||
empty-address-3a.t | ||
empty-address-3b.d | ||
empty-address-3b.t | ||
empty-address-3c.d | ||
empty-address-3c.t | ||
empty-address.exp | ||
empty-aligned.d | ||
empty-aligned.exp | ||
empty-aligned.s | ||
empty-aligned.t | ||
empty-orphan.d | ||
empty-orphan.exp | ||
empty-orphan.s | ||
empty-orphan.t | ||
expr.exp | ||
expr1.d | ||
expr1.s | ||
expr1.t | ||
expr2.d | ||
expr2.s | ||
expr2.t | ||
extern.exp | ||
extern.s | ||
extern.t | ||
fill.d | ||
fill.t | ||
fill_0.s | ||
fill_1.s | ||
fill_2.s | ||
include-1.d | ||
include-1.t | ||
include-data.t | ||
include-mem.t | ||
include-ram.t | ||
include-sections.t | ||
include-subdata.t | ||
include.exp | ||
include.s | ||
log2.exp | ||
log2.s | ||
log2.t | ||
map-address.d | ||
map-address.exp | ||
map-address.t | ||
memory.t | ||
memory_sym.t | ||
overlay-size-map.d | ||
overlay-size.d | ||
overlay-size.exp | ||
overlay-size.s | ||
overlay-size.t | ||
phdrs.exp | ||
phdrs.s | ||
phdrs.t | ||
phdrs2.exp | ||
phdrs2.s | ||
phdrs2.t | ||
phdrs3.d | ||
phdrs3.exp | ||
phdrs3.t | ||
phdrs3a.d | ||
phdrs3a.t | ||
pr14962-2.d | ||
pr14962-2.t | ||
pr14962.d | ||
pr14962.t | ||
pr14962a.s | ||
pr14962b.s | ||
pr18963.d | ||
pr18963.t | ||
print-memory-usage-1.l | ||
print-memory-usage-1.s | ||
print-memory-usage-1.t | ||
print-memory-usage-2.l | ||
print-memory-usage-2.t | ||
print-memory-usage-3.l | ||
print-memory-usage-3.s | ||
print-memory-usage-3.t | ||
print-memory-usage.exp | ||
print-memory-usage.t | ||
provide-1.d | ||
provide-1.s | ||
provide-1.t | ||
provide-2.d | ||
provide-2.s | ||
provide-2.t | ||
provide-3.d | ||
provide-3.s | ||
provide-3.t | ||
provide-4-map.d | ||
provide-4.d | ||
provide-4.t | ||
provide-5-map.d | ||
provide-5.d | ||
provide-5.s | ||
provide-5.t | ||
provide.exp | ||
region-alias-1.d | ||
region-alias-1.t | ||
region-alias-2.d | ||
region-alias-2.t | ||
region-alias-3.d | ||
region-alias-3.t | ||
region-alias-4.d | ||
region-alias-4.t | ||
rgn-at.exp | ||
rgn-at.s | ||
rgn-at1.d | ||
rgn-at1.t | ||
rgn-at2.d | ||
rgn-at2.t | ||
rgn-at3.d | ||
rgn-at3.t | ||
rgn-at4.d | ||
rgn-at4.t | ||
rgn-at5.d | ||
rgn-at5.s | ||
rgn-at5.t | ||
rgn-at6.d | ||
rgn-at6.s | ||
rgn-at6.t | ||
rgn-at7.d | ||
rgn-at7.t | ||
rgn-at8.d | ||
rgn-at8.t | ||
rgn-at9.d | ||
rgn-at9.t | ||
rgn-at10.d | ||
rgn-at10.s | ||
rgn-at10.t | ||
rgn-at11.d | ||
rgn-at11.t | ||
rgn-over.exp | ||
rgn-over.s | ||
rgn-over1.d | ||
rgn-over1.t | ||
rgn-over2.d | ||
rgn-over2.t | ||
rgn-over3.d | ||
rgn-over3.t | ||
rgn-over4.d | ||
rgn-over4.t | ||
rgn-over5.d | ||
rgn-over5.t | ||
rgn-over6.d | ||
rgn-over6.t | ||
rgn-over7.d | ||
rgn-over7.t | ||
rgn-over8-ok.d | ||
rgn-over8.s | ||
rgn-over8.t | ||
sane1.d | ||
sane1.t | ||
script.exp | ||
script.s | ||
script.t | ||
scriptm.t | ||
section-flags-1.s | ||
section-flags-1.t | ||
section-flags-2.s | ||
section-flags-2.t | ||
section-flags.exp | ||
section-match-1.d | ||
section-match-1.s | ||
section-match-1.t | ||
section-match.exp | ||
size-1.d | ||
size-1.s | ||
size-1.t | ||
size-2.d | ||
size-2.s | ||
size-2.t | ||
size.exp | ||
sizeof.exp | ||
sizeof.s | ||
sizeof.t | ||
sort.exp | ||
sort.t | ||
sort_b_a-1.d | ||
sort_b_a-1.s | ||
sort_b_a.d | ||
sort_b_a.s | ||
sort_b_a.t | ||
sort_b_a_a-1.d | ||
sort_b_a_a-2.d | ||
sort_b_a_a-3.d | ||
sort_b_a_a.t | ||
sort_b_a_n-1.d | ||
sort_b_a_n-2.d | ||
sort_b_a_n-3.d | ||
sort_b_a_n.t | ||
sort_b_n-1.d | ||
sort_b_n-1.s | ||
sort_b_n.d | ||
sort_b_n.s | ||
sort_b_n.t | ||
sort_b_n_a-1.d | ||
sort_b_n_a-2.d | ||
sort_b_n_a-3.d | ||
sort_b_n_a.t | ||
sort_b_n_n-1.d | ||
sort_b_n_n-2.d | ||
sort_b_n_n-3.d | ||
sort_b_n_n.t | ||
sort_n_a-a.s | ||
sort_n_a-b.s | ||
sort_no-1.d | ||
sort_no-2.d | ||
sort_no.t | ||
sysroot-prefix-x.s | ||
sysroot-prefix-y.s | ||
sysroot-prefix.exp | ||
weak.exp | ||
weak.t | ||
weak1.s | ||
weak2.s |