diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/ia64/scripts |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'arch/ia64/scripts')
-rwxr-xr-x | arch/ia64/scripts/check-gas | 15 | ||||
-rw-r--r-- | arch/ia64/scripts/check-gas-asm.S | 2 | ||||
-rw-r--r-- | arch/ia64/scripts/check-model.c | 1 | ||||
-rw-r--r-- | arch/ia64/scripts/check-segrel.S | 4 | ||||
-rw-r--r-- | arch/ia64/scripts/check-segrel.lds | 11 | ||||
-rw-r--r-- | arch/ia64/scripts/check-serialize.S | 2 | ||||
-rw-r--r-- | arch/ia64/scripts/check-text-align.S | 6 | ||||
-rwxr-xr-x | arch/ia64/scripts/toolchain-flags | 53 | ||||
-rwxr-xr-x | arch/ia64/scripts/unwcheck.py | 64 |
9 files changed, 158 insertions, 0 deletions
diff --git a/arch/ia64/scripts/check-gas b/arch/ia64/scripts/check-gas new file mode 100755 index 000000000000..2499e0b2243d --- /dev/null +++ b/arch/ia64/scripts/check-gas | |||
@@ -0,0 +1,15 @@ | |||
1 | #!/bin/sh | ||
2 | dir=$(dirname $0) | ||
3 | CC=$1 | ||
4 | OBJDUMP=$2 | ||
5 | tmp=${TMPDIR:-/tmp} | ||
6 | out=$tmp/out$$.o | ||
7 | $CC -c $dir/check-gas-asm.S -o $out | ||
8 | res=$($OBJDUMP -r --section .data $out | fgrep 00004 | tr -s ' ' |cut -f3 -d' ') | ||
9 | rm -f $out | ||
10 | if [ $res != ".text" ]; then | ||
11 | echo buggy | ||
12 | else | ||
13 | echo good | ||
14 | fi | ||
15 | exit 0 | ||
diff --git a/arch/ia64/scripts/check-gas-asm.S b/arch/ia64/scripts/check-gas-asm.S new file mode 100644 index 000000000000..010e1d227e5d --- /dev/null +++ b/arch/ia64/scripts/check-gas-asm.S | |||
@@ -0,0 +1,2 @@ | |||
1 | [1:] nop 0 | ||
2 | .xdata4 ".data", 0, 1b-. | ||
diff --git a/arch/ia64/scripts/check-model.c b/arch/ia64/scripts/check-model.c new file mode 100644 index 000000000000..e1d4e86e3d63 --- /dev/null +++ b/arch/ia64/scripts/check-model.c | |||
@@ -0,0 +1 @@ | |||
int __attribute__ ((__model__ (__small__))) x; | |||
diff --git a/arch/ia64/scripts/check-segrel.S b/arch/ia64/scripts/check-segrel.S new file mode 100644 index 000000000000..3be4e3dbeb83 --- /dev/null +++ b/arch/ia64/scripts/check-segrel.S | |||
@@ -0,0 +1,4 @@ | |||
1 | .rodata | ||
2 | data4 @segrel(start) | ||
3 | .data | ||
4 | start: | ||
diff --git a/arch/ia64/scripts/check-segrel.lds b/arch/ia64/scripts/check-segrel.lds new file mode 100644 index 000000000000..1c2f13e181d0 --- /dev/null +++ b/arch/ia64/scripts/check-segrel.lds | |||
@@ -0,0 +1,11 @@ | |||
1 | SECTIONS { | ||
2 | . = SIZEOF_HEADERS; | ||
3 | .rodata : { *(.rodata) } :ro | ||
4 | . = 0xa0000; | ||
5 | .data : { *(.data) } :dat | ||
6 | /DISCARD/ : { *(*) } | ||
7 | } | ||
8 | PHDRS { | ||
9 | ro PT_LOAD FILEHDR PHDRS; | ||
10 | dat PT_LOAD; | ||
11 | } | ||
diff --git a/arch/ia64/scripts/check-serialize.S b/arch/ia64/scripts/check-serialize.S new file mode 100644 index 000000000000..0400c106806c --- /dev/null +++ b/arch/ia64/scripts/check-serialize.S | |||
@@ -0,0 +1,2 @@ | |||
1 | .serialize.data | ||
2 | .serialize.instruction | ||
diff --git a/arch/ia64/scripts/check-text-align.S b/arch/ia64/scripts/check-text-align.S new file mode 100644 index 000000000000..03f586abb734 --- /dev/null +++ b/arch/ia64/scripts/check-text-align.S | |||
@@ -0,0 +1,6 @@ | |||
1 | .proc foo | ||
2 | .prologue | ||
3 | foo: .save rp, r2 | ||
4 | nop 0 | ||
5 | .align 64 | ||
6 | .endp foo | ||
diff --git a/arch/ia64/scripts/toolchain-flags b/arch/ia64/scripts/toolchain-flags new file mode 100755 index 000000000000..3f0c2adacb70 --- /dev/null +++ b/arch/ia64/scripts/toolchain-flags | |||
@@ -0,0 +1,53 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Check whether linker can handle cross-segment @segrel(): | ||
4 | # | ||
5 | CPPFLAGS="" | ||
6 | CC=$1 | ||
7 | OBJDUMP=$2 | ||
8 | READELF=$3 | ||
9 | dir=$(dirname $0) | ||
10 | tmp=${TMPDIR:-/tmp} | ||
11 | out=$tmp/out$$ | ||
12 | |||
13 | # Check whether cross-segment segment-relative relocs work fine. We need | ||
14 | # that for building the gate DSO: | ||
15 | |||
16 | $CC -nostdlib -static -Wl,-T$dir/check-segrel.lds $dir/check-segrel.S -o $out | ||
17 | res=$($OBJDUMP --full --section .rodata $out | fgrep 000 | cut -f3 -d' ') | ||
18 | rm -f $out | ||
19 | if [ $res != 00000a00 ]; then | ||
20 | CPPFLAGS="$CPPFLAGS -DHAVE_BUGGY_SEGREL" | ||
21 | cat >&2 <<EOF | ||
22 | warning: your linker cannot handle cross-segment segment-relative relocations. | ||
23 | please upgrade to a newer version (it is safe to use this linker, but | ||
24 | the kernel will be bigger than strictly necessary). | ||
25 | EOF | ||
26 | fi | ||
27 | |||
28 | # Check whether .align inside a function works as expected. | ||
29 | |||
30 | $CC -c $dir/check-text-align.S -o $out | ||
31 | $READELF -u $out | fgrep -q 'prologue(rlen=12)' | ||
32 | res=$? | ||
33 | rm -f $out | ||
34 | if [ $res -eq 0 ]; then | ||
35 | CPPFLAGS="$CPPFLAGS -DHAVE_WORKING_TEXT_ALIGN" | ||
36 | fi | ||
37 | |||
38 | if ! $CC -c $dir/check-model.c -o $out 2>&1 | grep __model__ | grep -q attrib | ||
39 | then | ||
40 | CPPFLAGS="$CPPFLAGS -DHAVE_MODEL_SMALL_ATTRIBUTE" | ||
41 | fi | ||
42 | rm -f $out | ||
43 | |||
44 | # Check whether assembler supports .serialize.{data,instruction} directive. | ||
45 | |||
46 | $CC -c $dir/check-serialize.S -o $out 2>/dev/null | ||
47 | res=$? | ||
48 | rm -f $out | ||
49 | if [ $res -eq 0 ]; then | ||
50 | CPPFLAGS="$CPPFLAGS -DHAVE_SERIALIZE_DIRECTIVE" | ||
51 | fi | ||
52 | |||
53 | echo $CPPFLAGS | ||
diff --git a/arch/ia64/scripts/unwcheck.py b/arch/ia64/scripts/unwcheck.py new file mode 100755 index 000000000000..c27849889e19 --- /dev/null +++ b/arch/ia64/scripts/unwcheck.py | |||
@@ -0,0 +1,64 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # | ||
3 | # Usage: unwcheck.py FILE | ||
4 | # | ||
5 | # This script checks the unwind info of each function in file FILE | ||
6 | # and verifies that the sum of the region-lengths matches the total | ||
7 | # length of the function. | ||
8 | # | ||
9 | # Based on a shell/awk script originally written by Harish Patil, | ||
10 | # which was converted to Perl by Matthew Chapman, which was converted | ||
11 | # to Python by David Mosberger. | ||
12 | # | ||
13 | import os | ||
14 | import re | ||
15 | import sys | ||
16 | |||
17 | if len(sys.argv) != 2: | ||
18 | print "Usage: %s FILE" % sys.argv[0] | ||
19 | sys.exit(2) | ||
20 | |||
21 | readelf = os.getenv("READELF", "readelf") | ||
22 | |||
23 | start_pattern = re.compile("<([^>]*)>: \[0x([0-9a-f]+)-0x([0-9a-f]+)\]") | ||
24 | rlen_pattern = re.compile(".*rlen=([0-9]+)") | ||
25 | |||
26 | def check_func (func, slots, rlen_sum): | ||
27 | if slots != rlen_sum: | ||
28 | global num_errors | ||
29 | num_errors += 1 | ||
30 | if not func: func = "[%#x-%#x]" % (start, end) | ||
31 | print "ERROR: %s: %lu slots, total region length = %lu" % (func, slots, rlen_sum) | ||
32 | return | ||
33 | |||
34 | num_funcs = 0 | ||
35 | num_errors = 0 | ||
36 | func = False | ||
37 | slots = 0 | ||
38 | rlen_sum = 0 | ||
39 | for line in os.popen("%s -u %s" % (readelf, sys.argv[1])): | ||
40 | m = start_pattern.match(line) | ||
41 | if m: | ||
42 | check_func(func, slots, rlen_sum) | ||
43 | |||
44 | func = m.group(1) | ||
45 | start = long(m.group(2), 16) | ||
46 | end = long(m.group(3), 16) | ||
47 | slots = 3 * (end - start) / 16 | ||
48 | rlen_sum = 0L | ||
49 | num_funcs += 1 | ||
50 | else: | ||
51 | m = rlen_pattern.match(line) | ||
52 | if m: | ||
53 | rlen_sum += long(m.group(1)) | ||
54 | check_func(func, slots, rlen_sum) | ||
55 | |||
56 | if num_errors == 0: | ||
57 | print "No errors detected in %u functions." % num_funcs | ||
58 | else: | ||
59 | if num_errors > 1: | ||
60 | err="errors" | ||
61 | else: | ||
62 | err="error" | ||
63 | print "%u %s detected in %u functions." % (num_errors, err, num_funcs) | ||
64 | sys.exit(1) | ||