This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
__attribute__((constructor(<prio>))) creating inconsistent sections
- From: Dan Ciliske <dciliske at netburner dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 11 Oct 2016 01:57:18 -0700
- Subject: __attribute__((constructor(<prio>))) creating inconsistent sections
- Authentication-results: sourceware.org; auth=none
Version: 5.2.0
Target: m68k-elf
Host: darwin
I’m attempting to resolve some boot order dependency issues on a bare metal target using __attribute__((constructor)). It appears that it and init_priority should take care of all my issues, but I need to get them to play nicely with the linker as well. The problem that I’m having is that sometimes the compiler will generate sections along the line of ‘.ctors.<65535-prio>’ and other times it will simply use ‘.ctors'. The main issue with the the second form is that it carries no priority information for use in the link step.
I figure that it’s related to whether or not there’s other constructors called for the compilation unit that lack priority configurations, but I cannot rely on that for the application.
Does anyone have an idea to point me in the right direction with?
Thanks,
-Dan