forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'akpm' (patches from Andrew Morton)
Merge misc fixes from Andrew Morton: "Six fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: drivers/rtc/rtc-s5m.c: terminate s5m_rtc_id array with empty element printk: add dummy routine for when CONFIG_PRINTK=n mm/vmscan: fix highidx argument type memcg: remove extra newlines from memcg oom kill log x86, build: replace Perl script with Shell script mm: page_alloc: embed OOM killing naturally into allocation slowpath
- Loading branch information
Showing
9 changed files
with
94 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/sh | ||
# | ||
# Calculate the amount of space needed to run the kernel, including room for | ||
# the .bss and .brk sections. | ||
# | ||
# Usage: | ||
# objdump -h a.out | sh calc_run_size.sh | ||
|
||
NUM='\([0-9a-fA-F]*[ \t]*\)' | ||
OUT=$(sed -n 's/^[ \t0-9]*.b[sr][sk][ \t]*'"$NUM$NUM$NUM$NUM"'.*/\1\4/p') | ||
if [ -z "$OUT" ] ; then | ||
echo "Never found .bss or .brk file offset" >&2 | ||
exit 1 | ||
fi | ||
|
||
OUT=$(echo ${OUT# }) | ||
sizeA=$(printf "%d" 0x${OUT%% *}) | ||
OUT=${OUT#* } | ||
offsetA=$(printf "%d" 0x${OUT%% *}) | ||
OUT=${OUT#* } | ||
sizeB=$(printf "%d" 0x${OUT%% *}) | ||
OUT=${OUT#* } | ||
offsetB=$(printf "%d" 0x${OUT%% *}) | ||
|
||
run_size=$(( $offsetA + $sizeA + $sizeB )) | ||
|
||
# BFD linker shows the same file offset in ELF. | ||
if [ "$offsetA" -ne "$offsetB" ] ; then | ||
# Gold linker shows them as consecutive. | ||
endB=$(( $offsetB + $sizeB )) | ||
if [ "$endB" != "$run_size" ] ; then | ||
printf "sizeA: 0x%x\n" $sizeA >&2 | ||
printf "offsetA: 0x%x\n" $offsetA >&2 | ||
printf "sizeB: 0x%x\n" $sizeB >&2 | ||
printf "offsetB: 0x%x\n" $offsetB >&2 | ||
echo ".bss and .brk are non-contiguous" >&2 | ||
exit 1 | ||
fi | ||
fi | ||
|
||
printf "%d\n" $run_size | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters