Been working on using github.com/backtrace-la... which does cross modifying code for negligible overhead flags. But when I tried to use it I got dreaded linker errors with the '__start' and '__stop' symbols for the custom sections that were supposed to be generated at link time missing...
Post
github.comGitHub - backtrace-labs/dynamic_flag: A C library for runtime-flippable feature flags on Linux/x86-64, with negligible overhead in the common caseA C library for runtime-flippable feature flags on Linux/x86-64, with negligible overhead in the common case - backtrace-labs/dynamic_flag
So dynamic flag automatically generates sections using inline assembly. One section has the list of all flags. Then there are arbitrarily many other sections that are a “view” into that list of flags for more efficient lookups. There is no access of any sections beyond using '__start' and '__stop'
0 reposts0 likes
Of course this is where I ended up at maskray’s blog doing deep reads of linker GC (maskray.me/blog/2021-02... ) and metadata sections (maskray.me/blog/2021-01...). I realized the main flag list should always exist and the view should only be kept if in use.