[haiku-commits] Change in ...haiku[master]: runtime_loader: Rework static initialization handling.

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 27 Jan 2019 01:09:06 +0000

From waddlesplash <waddlesplash@xxxxxxxxx>:

waddlesplash has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/907


Change subject: runtime_loader: Rework static initialization handling.
......................................................................

runtime_loader: Rework static initialization handling.

Previously, static initializers were just in ".ctors", which was handled
by GCC's crtbeginS, and that was injected in-between crti and crtn. Now,
however, binutils puts static initializers into init_array/fini_array by
default, which runtime_loader handles, but of course as initialize_after and
terminate_after are supposed to be called *after* all static initializers
are called; and since runtime_loader called init_array after _init, they
were not.

Now, we get rid of the __haiku_init_before/etc. functions, and move their
functionality inside runtime_loader. This is a "soft" ABI breakage,
which is mitigated by adding another ABI breakage (runtime_loader now
returns NULL for the initialize_before/etc. symbols, as otherwise
old applications would have their initialize_before/etc. called twice;
once by runtime_loader, and then once by __haiku_init_before/etc.)

I don't see or know of any reason why an application would want to
get those symbols at runtime, though, so this shouldn't have any
adverse effects.
---
M src/system/glue/arch/arm/crti.S
M src/system/glue/arch/arm/crtn.S
M src/system/glue/arch/m68k/crti.S
M src/system/glue/arch/m68k/crtn.S
M src/system/glue/arch/ppc/crti.S
M src/system/glue/arch/ppc/crtn.S
M src/system/glue/arch/riscv32/crti.S
M src/system/glue/arch/riscv32/crtn.S
M src/system/glue/arch/riscv64/crti.S
M src/system/glue/arch/riscv64/crtn.S
M src/system/glue/arch/x86/crti.S
M src/system/glue/arch/x86/crtn.S
M src/system/glue/arch/x86_64/crti.S
M src/system/glue/arch/x86_64/crtn.S
M src/system/glue/init_term_dyn.c
D src/system/glue/init_term_dyn.h
M src/system/runtime_loader/elf.cpp
M src/system/runtime_loader/elf_load_image.cpp
18 files changed, 75 insertions(+), 155 deletions(-)



  git pull ssh://git.haiku-os.org/haiku refs/changes/07/907/1
--
To view, visit https://review.haiku-os.org/c/haiku/+/907
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I42344c63f69c6f8ef260f6c3ca30202b6dfb153e
Gerrit-Change-Number: 907
Gerrit-PatchSet: 1
Gerrit-Owner: waddlesplash <waddlesplash@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in ...haiku[master]: runtime_loader: Rework static initialization handling. - Gerrit