Re: undefined reference to __aeabi_unwind_cpp_pr1, __cxa_end_cleanup

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

 



JJ <alchemistmba@xxxxxxxxx> writes:

> I have a few questions about the ctors/dtors section. I've defined
> these in my linker script:
>         __ctors = .;
>         .ctors : { *(.ctors) }
>         __dtors = .;
>         .dtors : { *(.dtors) }
>
> When I disassemble my binary, I don't see these labels. Could this be
> because the linker cannot find any .ctors/.dtors sections? I do have
> constructors/destructors defined for my C++ classes.

These symbols are normally in the read-only data section, so it's
normal to not see them when you disassemble.  The .ctors and .dtors
sections are normally not executable code, but instead lists of
addresses of functions to call at global constructor/destructor time.


> I've defined a custom "_start" section in assembly. The existing code
> seems to get the first address out of the ctors section and jumps to
> it. I guess the ctors section contains pointers to the constructor
> functions?

Right.

> Since the binary doesn't contain a ctors/dtors section, the
> execution jumps to the wrong address.

The first entry is normally a zero word.

> Could you point me to some documentation on the ctors and dtors areas?
> I couldn't find any good info online.

I don't think there is any docs on this.  The first word in the
sections normally comes from crtbegin.o or crtend.o, which are
provided by gcc.

Ian

[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