Skip to content

Commit

Permalink
x86/brk: put the brk reservations in their own section
Browse files Browse the repository at this point in the history
Impact: disambiguate real .bss variables from .brk storage

Add a .brk section after the .bss section.  This has no effect
on the final vmlinux, but it more clearly distinguishes the space
taken by actual .bss symbols, and the variable space reserved
by .brk users.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
  • Loading branch information
Jeremy Fitzhardinge committed Mar 17, 2009
1 parent 0b1c723 commit 704439d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions arch/x86/kernel/vmlinux_32.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,18 @@ SECTIONS
*(.bss)
. = ALIGN(4);
__bss_stop = .;
}

.brk : AT(ADDR(.brk) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE);
__brk_base = . ;
. += 64 * 1024 ; /* 64k slop space */
. += 64 * 1024 ; /* 64k alignment slop space */
*(.brk_reservation) /* areas brk users have reserved */
__brk_limit = . ;

_end = . ;
}

_end = . ;

/* Sections to be discarded */
/DISCARD/ : {
*(.exitcall.exit)
Expand Down
4 changes: 3 additions & 1 deletion arch/x86/kernel/vmlinux_64.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,12 @@ SECTIONS
*(.bss.page_aligned)
*(.bss)
__bss_stop = .;
}

.brk : AT(ADDR(.brk) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE);
__brk_base = . ;
. += 64 * 1024; /* 64k slop space */
. += 64 * 1024 ; /* 64k alignment slop space */
*(.brk_reservation) /* areas brk users have reserved */
__brk_limit = . ;
}
Expand Down

0 comments on commit 704439d

Please sign in to comment.