AmigaLabs / binutils-gdb

binutils targeted for ppc-amigaos systems (AmigaOS NG like OS4.1).
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git
GNU General Public License v2.0
0 stars 0 forks source link

Support for init_array/fini_array #6

Open migthymax opened 1 year ago

migthymax commented 1 year ago

Support for init_array/fini_array which redeem the old dtors/ctors mechanism for constructors/destructors

kas1e commented 1 year ago

To add a bit to the ticket : we should have keep support for ctor/dtors and just be able to use init_array/fini_array when need it. Checking the elf.library's changelog, i find that Alfkil add support for fini/init, but it wasn't tested. There are relevant part:

- Elf32_CallConstructors/Destructors have been updated to account for  .init_array and .fini_array sections (untested).

So, that to be seen if elf.library is "ok" with.

And just in case we need that later , there are pretty good discussion of fini/init/ctor/dtor stuff on gnu.org, with bunch of test cases and stuff: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770

also there nice article about which may help us too: https://maskray.me/blog/2021-11-07-init-ctors-init-array