Re: __attribute__((constructor(<prio>))) creating inconsistent sections

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

 



I hate to be that guy who post’s a question and then answers his own thing, but I guess I can save y’all the trouble: The issue turned out to be a declaration in the header file overriding the function declaration that contained the __attribute__, effectively eliminating it.

-Dan

> On Oct 11, 2016, at 1:57 AM, Dan Ciliske <dciliske@xxxxxxxxxxxxx> wrote:
> 
> 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
> 
> 





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux