[PATCH] D127056: [ORC][ORC_RT] Handle ELF .init_array with non-default priority

Peter S. Housel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 4 17:09:45 PDT 2022


housel created this revision.
housel added a reviewer: lhames.
Herald added subscribers: Enna1, StephenFan, mgrang, hiraditya, emaste.
Herald added a project: All.
housel requested review of this revision.
Herald added projects: Sanitizers, LLVM.
Herald added subscribers: llvm-commits, Sanitizers.

ELF-based platforms currently support defining multiple static initializer table sections with differing priorities, for example `.init_array.0` or `.init_array.100`; the default `.init_array` corresponds to a priority of 65535. When building a shared library or executable, the system linker normally sorts these sections and combines them into a single `.init_array` section. This change adds the capability to recognize ELF static initializers with priorities other than the default, and to properly sort them by priority, to Orc and the Orc runtime.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127056

Files:
  compiler-rt/lib/orc/elfnix_platform.cpp
  compiler-rt/lib/orc/elfnix_platform.h
  compiler-rt/test/orc/TestCases/FreeBSD/x86-64/priority-static-initializer.S
  compiler-rt/test/orc/TestCases/Linux/x86-64/priority-static-initializer.S
  llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
  llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127056.434294.patch
Type: text/x-patch
Size: 9740 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220605/be6891f8/attachment.bin>


More information about the llvm-commits mailing list