This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gold patch committed: Reverse .ctors in .init_array


> Alan pointed out that when a .ctors sections which has multiple words is
> mapped to a .init_array section, we need to reverse the order of the
> entries in the .ctors section. ?This is because .ctors and .init_array
> are executed in reverse order, and we don't want the linker to change
> the order in which the constructors are executed. ?The same applies to
> .dtors mapped to .fini_array. ?This patch implements that in gold.
> Committed to mainline.

I asked about this in the comment string for PR 46770, about HJ's
patch for ld. The answer there was that the compiler generates a
single function that calls the constructors in the right order, so it
wasn't necessary to reverse the contents of the .ctors section. What's
different here? Will gold and gnu ld give different behavior now?

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]