https://sourceware.org/bugzilla/show_bug.cgi?id=25122

--- Comment #1 from wxsxsdz at gmail dot com ---
ld will copy .ctors section from the input files to .init_array section in the
output file.
.ctors section should start with 0xffffffffffffffff and end with
0x0000000000000000. But .init_array shouldn't have these and should have it's
size explicitly specified somewhere.
So if we link some files with .ctors sections, the .init_array section in the
output file will contain some 0xffffffffffffffff entries. (As is observed in ld
2.30.51) And when ld.so loads the output file, it will segfault when calling
the 0xffffffffffffffff entries in .init_array.
In order not to segfault, we must 1) filter out 0xffffffffffffffff entries when
ld copies the .ctors section to .init_array section or 2) tell ld.so to ignore
the 0xffffffffffffffff entries in .init_array.
(I think ld.so is in glibc, so should I report this to glibc or binutils?)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to