Required alignment of .text versus .data
问题 I've been toying around with the ELFIO library. One of the examples, in particular, allows one to create an ELF file from scratch – defining sections, segments, entry point, and providing binary content to the relevant sections. I noticed that a program created this way segfaults when the code segment alignment is chosen less than the page size (0x1000): // Create a loadable segment segment* text_seg = writer.segments.add(); text_seg->set_type( PT_LOAD ); text_seg->set_virtual_address(