Azul @typeswitch·Jul 30Where do C compilers usually store literal strings? .data/.rodata/.text? ... asking for a friend.819
Tom Schouten@tom_zwizwaReplying to @typeswitchBonus points: how to move literal strings to a different segment?9:15 AM · Jul 30, 2022·Twitter Web App1 Like
Orion Lawlor@AlaskaLawlor·Jul 30Replying to @tom_zwizwa and @typeswitch__attribute__((section(".text#"))) const char mc[]="\xb8\x07\x00\x00\x00\xc3"; int main() { return ((int(*)())mc)(); }115
Orion Lawlor@AlaskaLawlor·Jul 30Replying to @AlaskaLawlor @tom_zwizwa and @typeswitch(At least on gcc 9 on x86-64, tested only on Linux.)2