mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 07:22:45 +00:00 
			
		
		
		
	 8e7420ddf2
			
		
	
	
		8e7420ddf2
		
	
	
	
	
		
			
			We now map the kernel's text and rodata segments read+execute. We also make the data and bss segments non-executable. Thanks to q3k for the idea! :^)
		
			
				
	
	
		
			41 lines
		
	
	
	
		
			573 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
	
		
			573 B
		
	
	
	
		
			Text
		
	
	
	
	
	
| ENTRY(start)
 | |
| 
 | |
| SECTIONS
 | |
| {
 | |
| 	. = 0x100000;
 | |
| 
 | |
| 	.text BLOCK(4K) : ALIGN(4K)
 | |
| 	{
 | |
|         Arch/i386/Boot/boot.ao
 | |
| 		*(.multiboot)
 | |
| 		*(.page_tables)
 | |
|         start_of_kernel_text = .;
 | |
| 		*(.text)
 | |
| 		*(.text.startup)
 | |
|         end_of_kernel_text = .;
 | |
| 	}
 | |
| 
 | |
| 	.rodata BLOCK(4K) : ALIGN(4K)
 | |
| 	{
 | |
| 		start_ctors = .;
 | |
| 		*(.ctors)
 | |
| 		end_ctors = .;
 | |
| 
 | |
| 		*(.rodata)
 | |
| 	}
 | |
| 
 | |
| 	.data BLOCK(4K) : ALIGN(4K)
 | |
| 	{
 | |
|         start_of_kernel_data = .;
 | |
| 		*(.data)
 | |
|         end_of_kernel_data = .;
 | |
| 	}
 | |
| 
 | |
| 	.bss BLOCK(4K) : ALIGN(4K)
 | |
| 	{
 | |
|         start_of_kernel_bss = .;
 | |
| 		*(COMMON)
 | |
| 		*(.bss)
 | |
|         end_of_kernel_bss = .;
 | |
| 	}
 | |
| }
 |