Last active
October 14, 2018 11:46
-
-
Save hackpascal/45e41225cc4c3d5cec16f3462a3c7c19 to your computer and use it in GitHub Desktop.
Embed a binary file into an object file which can be linked into a program and referenced by other source codes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.align 2 | |
.section ".rodata.data_start", "a" | |
.globl data_start | |
.type data_start, @object | |
data_start: | |
.incbin "data.bin" | |
.equ _data_size, . - data_start | |
.size data_start, _data_size | |
.align 2 | |
.section ".rodata.data_size", "a" | |
.globl data_size | |
.type data_size, @object | |
data_size: | |
.word _data_size | |
.size data_size, . - data_size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment