Advertisement
Guest User

Untitled

a guest
Sep 25th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Simple linker script for the JOS kernel.
  2.    See the GNU ld 'info' manual ("info ld") to learn the syntax. */
  3.  
  4. OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
  5. OUTPUT_ARCH(i386)
  6. ENTRY(_start)
  7.  
  8. SECTIONS
  9. {
  10.     /* Link the kernel at this address: "." means the current address */
  11.     . = 0xF0100000;
  12.  
  13.     /* AT(...) gives the load address of this section, which tells
  14.        the boot loader where to load the kernel in physical memory */
  15.     .text : AT(0x100000) {
  16.         *(.text .stub .text.* .gnu.linkonce.t.*)
  17.     }
  18.  
  19.     PROVIDE(etext = .); /* Define the 'etext' symbol to this value */
  20.  
  21.     .rodata : {
  22.         *(.rodata .rodata.* .gnu.linkonce.r.*)
  23.     }
  24.  
  25.     /* Include debugging information in kernel memory */
  26.     .stab : {
  27.         PROVIDE(__STAB_BEGIN__ = .);
  28.         *(.stab);
  29.         PROVIDE(__STAB_END__ = .);
  30.         BYTE(0)     /* Force the linker to allocate space
  31.                    for this section */
  32.     }
  33.  
  34.     .stabstr : {
  35.         PROVIDE(__STABSTR_BEGIN__ = .);
  36.         *(.stabstr);
  37.         PROVIDE(__STABSTR_END__ = .);
  38.         BYTE(0)     /* Force the linker to allocate space
  39.                    for this section */
  40.     }
  41.  
  42.     /* Adjust the address for the data segment to the next page */
  43.     . = ALIGN(0x1000);
  44.  
  45.     /* The data segment */
  46.     .data : {
  47.         *(.data)
  48.     }
  49.  
  50.     PROVIDE(edata = .);
  51.  
  52.     .bss : {
  53.         *(.bss)
  54.     }
  55.  
  56.     PROVIDE(end = .);
  57.  
  58.     /DISCARD/ : {
  59.         *(.eh_frame .note.GNU-stack)
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement