Created
January 7, 2014 11:38
-
-
Save souri/8298134 to your computer and use it in GitHub Desktop.
Supplement to Quora Answer: http://www.quora.com/Linux/How-can-I-make-the-text-section-writable-at-runtime-for-a-program-on-linux/answer/Souri-Guha
This file contains 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
OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", | |
"elf64-x86-64") | |
OUTPUT_ARCH(i386:x86-64) | |
ENTRY(_start) | |
SEARCH_DIR("/usr/x86_64-linux-gnu/lib64"); SEARCH_DIR("=/usr/local/lib/x86_64-linux-gnu"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib/x86_64-linux-gnu"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib/x86_64-linux-gnu"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); | |
MEMORY | |
{ | |
writablemem (wx) : ORIGIN = 0x0000000000400270, LENGTH = 0x72D | |
} | |
SECTIONS | |
{ | |
.text : | |
{ | |
*(.text.unlikely .text.*_unlikely .text.unlikely.*) | |
*(.text.exit .text.exit.*) | |
*(.text.startup .text.startup.*) | |
*(.text.hot .text.hot.*) | |
*(.text .stub .text.* .gnu.linkonce.t.*) | |
/* .gnu.warning sections are handled specially by elf32.em. */ | |
*(.gnu.warning) | |
} > writablemem | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment