bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/25122] behaviour of ld when copying .ctors to .init_array


From: wxsxsdz at gmail dot com
Subject: [Bug ld/25122] behaviour of ld when copying .ctors to .init_array
Date: Mon, 21 Oct 2019 10:37:28 +0000

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]