-
-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use gcc feature __attribute__ section to create the custom sections on the runtime #947
Comments
My plan for the future was to build a tool to take care of these things right before building the runtime, then build the runtime with it. We want to insert our magic bytes in a very custom location in the future, and that's the only way to do it properly. That said, I'm open to using this extension. How well is that supported? Do other compilers (mainly clang) support that? Can you run tests in AppImageBuild? |
There is a similar feature on clang http://www.keil.com/support/man/docs/armclang_ref/armclang_ref_cmf1493390581125.htm |
While looking for a solution for AppImageCommunity/libappimage#21 I found this nice gcc feature that will save us a lot of "fragile" cmake code at https://github.com/AppImage/AppImageKit/blob/master/src/build-runtime.cmake
Basically to create a 10 bites long section named
foo
we would use the code belowchar custom_section[10] __attribute__((section("foo"))) = {0x0};
Documentation can be found here http://www.keil.com/support/man/docs/armcc/armcc_chr1359124982450.htm
Here is an example of how it's used to append metadata to the linux kernel modules:
https://www.bottomupcs.com/elf-sections-others.xhtml#modinfo_sections
The text was updated successfully, but these errors were encountered: