]> git.ipfire.org Git - thirdparty/gcc.git/commit
Darwin: Partial reversion of r14-3648 (Inits Section).
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 10 Sep 2023 13:48:42 +0000 (14:48 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Thu, 18 Apr 2024 14:46:52 +0000 (15:46 +0100)
commita732f63ebc032fbcd7740156d497472d16bdea50
tree4160c387f120ceacf7ba55c992c44c48d0d88536
parent11d379f5ff8a5d3ce3ec4bc2f66471cab15c9ff7
Darwin: Partial reversion of r14-3648 (Inits Section).

Although the Darwin ABI places both hot and cold partitions in the same
section (the linker can partition by name), this does not work with the
current dwarf2out implementation.

Since we do see global initialization code getting hot/cold splits, this
patch places the cold parts into text_cold, and keeps the hot part in
the correct Init section per ABI.

TODO: figure out a way to allow us to match the ABI fully.

gcc/ChangeLog:

* config/darwin.cc (darwin_function_section): Place unlikely
executed global init code into the standard cold section.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
(cherry picked from commit 5b33b364652866165431aef1810af1e890229c5e)
gcc/config/darwin.cc