aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl6
-rwxr-xr-xscripts/coccicheck13
-rwxr-xr-xscripts/depmod.sh6
-rw-r--r--scripts/mod/file2alias.c37
-rw-r--r--scripts/mod/modpost.c9
-rw-r--r--scripts/package/builddeb12
6 files changed, 57 insertions, 26 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e3bfcbe8a520..a3b9782441f9 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1924,6 +1924,12 @@ sub process {
1924 my $pre_ctx = "$1$2"; 1924 my $pre_ctx = "$1$2";
1925 1925
1926 my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0); 1926 my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0);
1927
1928 if ($line =~ /^\+\t{6,}/) {
1929 WARN("DEEP_INDENTATION",
1930 "Too many leading tabs - consider code refactoring\n" . $herecurr);
1931 }
1932
1927 my $ctx_cnt = $realcnt - $#ctx - 1; 1933 my $ctx_cnt = $realcnt - $#ctx - 1;
1928 my $ctx = join("\n", @ctx); 1934 my $ctx = join("\n", @ctx);
1929 1935
diff --git a/scripts/coccicheck b/scripts/coccicheck
index 3c2776466d87..823e972149e5 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -9,15 +9,10 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
9# FLAGS="-ignore_unknown_options -very_quiet" 9# FLAGS="-ignore_unknown_options -very_quiet"
10# OPTIONS=$* 10# OPTIONS=$*
11 11
12 if [ "$KBUILD_EXTMOD" = "" ] ; then 12# Workaround for Coccinelle < 0.2.3
13 # Workaround for Coccinelle < 0.2.3 13 FLAGS="-I $srctree/include -very_quiet"
14 FLAGS="-I $srctree/include -very_quiet" 14 shift $(( $# - 1 ))
15 shift $(( $# - 1 )) 15 OPTIONS=$1
16 OPTIONS=$1
17 else
18 echo M= is not currently supported when C=1 or C=2
19 exit 1
20 fi
21else 16else
22 ONLINE=0 17 ONLINE=0
23 FLAGS="-very_quiet" 18 FLAGS="-very_quiet"
diff --git a/scripts/depmod.sh b/scripts/depmod.sh
index a27235685949..2ae481703141 100755
--- a/scripts/depmod.sh
+++ b/scripts/depmod.sh
@@ -9,12 +9,6 @@ fi
9DEPMOD=$1 9DEPMOD=$1
10KERNELRELEASE=$2 10KERNELRELEASE=$2
11 11
12if ! "$DEPMOD" -V 2>/dev/null | grep -q module-init-tools; then
13 echo "Warning: you may need to install module-init-tools" >&2
14 echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt" >&2
15 sleep 1
16fi
17
18if ! test -r System.map -a -x "$DEPMOD"; then 12if ! test -r System.map -a -x "$DEPMOD"; then
19 exit 0 13 exit 0
20fi 14fi
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 78fd81fb9732..8e730ccc3f2b 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -46,11 +46,37 @@ struct devtable {
46 void *function; 46 void *function;
47}; 47};
48 48
49#define ___cat(a,b) a ## b
50#define __cat(a,b) ___cat(a,b)
51
52/* we need some special handling for this host tool running eventually on
53 * Darwin. The Mach-O section handling is a bit different than ELF section
54 * handling. The differnces in detail are:
55 * a) we have segments which have sections
56 * b) we need a API call to get the respective section symbols */
57#if defined(__MACH__)
58#include <mach-o/getsect.h>
59
60#define INIT_SECTION(name) do { \
61 unsigned long name ## _len; \
62 char *__cat(pstart_,name) = getsectdata("__TEXT", \
63 #name, &__cat(name,_len)); \
64 char *__cat(pstop_,name) = __cat(pstart_,name) + \
65 __cat(name, _len); \
66 __cat(__start_,name) = (void *)__cat(pstart_,name); \
67 __cat(__stop_,name) = (void *)__cat(pstop_,name); \
68 } while (0)
69#define SECTION(name) __attribute__((section("__TEXT, " #name)))
70
71struct devtable **__start___devtable, **__stop___devtable;
72#else
73#define INIT_SECTION(name) /* no-op for ELF */
74#define SECTION(name) __attribute__((section(#name)))
75
49/* We construct a table of pointers in an ELF section (pointers generally 76/* We construct a table of pointers in an ELF section (pointers generally
50 * go unpadded by gcc). ld creates boundary syms for us. */ 77 * go unpadded by gcc). ld creates boundary syms for us. */
51extern struct devtable *__start___devtable[], *__stop___devtable[]; 78extern struct devtable *__start___devtable[], *__stop___devtable[];
52#define ___cat(a,b) a ## b 79#endif /* __MACH__ */
53#define __cat(a,b) ___cat(a,b)
54 80
55#if __GNUC__ == 3 && __GNUC_MINOR__ < 3 81#if __GNUC__ == 3 && __GNUC_MINOR__ < 3
56# define __used __attribute__((__unused__)) 82# define __used __attribute__((__unused__))
@@ -65,8 +91,8 @@ extern struct devtable *__start___devtable[], *__stop___devtable[];
65 (type *)NULL, \ 91 (type *)NULL, \
66 (char *)NULL)), \ 92 (char *)NULL)), \
67 sizeof(type), (function) }; \ 93 sizeof(type), (function) }; \
68 static struct devtable *__attribute__((section("__devtable"))) \ 94 static struct devtable *SECTION(__devtable) __used \
69 __used __cat(devtable_ptr,__LINE__) = &__cat(devtable,__LINE__) 95 __cat(devtable_ptr,__LINE__) = &__cat(devtable,__LINE__)
70 96
71#define ADD(str, sep, cond, field) \ 97#define ADD(str, sep, cond, field) \
72do { \ 98do { \
@@ -932,7 +958,7 @@ static int do_isapnp_entry(const char *filename,
932 (id->function >> 12) & 0x0f, (id->function >> 8) & 0x0f); 958 (id->function >> 12) & 0x0f, (id->function >> 8) & 0x0f);
933 return 1; 959 return 1;
934} 960}
935ADD_TO_DEVTABLE("isa", struct isapnp_device_id, do_isapnp_entry); 961ADD_TO_DEVTABLE("isapnp", struct isapnp_device_id, do_isapnp_entry);
936 962
937/* 963/*
938 * Append a match expression for a single masked hex digit. 964 * Append a match expression for a single masked hex digit.
@@ -1105,6 +1131,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
1105 do_pnp_card_entries(symval, sym->st_size, mod); 1131 do_pnp_card_entries(symval, sym->st_size, mod);
1106 else { 1132 else {
1107 struct devtable **p; 1133 struct devtable **p;
1134 INIT_SECTION(__devtable);
1108 1135
1109 for (p = __start___devtable; p < __stop___devtable; p++) { 1136 for (p = __start___devtable; p < __stop___devtable; p++) {
1110 if (sym_is(name, namelen, (*p)->device_id)) { 1137 if (sym_is(name, namelen, (*p)->device_id)) {
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 2bd594e6d1b4..9adb667dd31a 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1494,6 +1494,13 @@ static int addend_386_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
1494 return 0; 1494 return 0;
1495} 1495}
1496 1496
1497#ifndef R_ARM_CALL
1498#define R_ARM_CALL 28
1499#endif
1500#ifndef R_ARM_JUMP24
1501#define R_ARM_JUMP24 29
1502#endif
1503
1497static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r) 1504static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
1498{ 1505{
1499 unsigned int r_typ = ELF_R_TYPE(r->r_info); 1506 unsigned int r_typ = ELF_R_TYPE(r->r_info);
@@ -1505,6 +1512,8 @@ static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
1505 (elf->symtab_start + ELF_R_SYM(r->r_info)); 1512 (elf->symtab_start + ELF_R_SYM(r->r_info));
1506 break; 1513 break;
1507 case R_ARM_PC24: 1514 case R_ARM_PC24:
1515 case R_ARM_CALL:
1516 case R_ARM_JUMP24:
1508 /* From ARM ABI: ((S + A) | T) - P */ 1517 /* From ARM ABI: ((S + A) | T) - P */
1509 r->r_addend = (int)(long)(elf->hdr + 1518 r->r_addend = (int)(long)(elf->hdr +
1510 sechdr->sh_offset + 1519 sechdr->sh_offset +
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index f6cbc3ddb68b..3c6c0b14c807 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -238,14 +238,14 @@ EOF
238fi 238fi
239 239
240# Build header package 240# Build header package
241(cd $srctree; find . -name Makefile -o -name Kconfig\* -o -name \*.pl > /tmp/files$$) 241(cd $srctree; find . -name Makefile -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles")
242(cd $srctree; find arch/$SRCARCH/include include scripts -type f >> /tmp/files$$) 242(cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles")
243(cd $objtree; find .config Module.symvers include scripts -type f >> /tmp/objfiles$$) 243(cd $objtree; find .config Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles")
244destdir=$kernel_headers_dir/usr/src/linux-headers-$version 244destdir=$kernel_headers_dir/usr/src/linux-headers-$version
245mkdir -p "$destdir" 245mkdir -p "$destdir"
246(cd $srctree; tar -c -f - -T /tmp/files$$) | (cd $destdir; tar -xf -) 246(cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -)
247(cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -) 247(cd $objtree; tar -c -f - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -)
248rm -f /tmp/files$$ /tmp/objfiles$$ 248rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
249arch=$(dpkg --print-architecture) 249arch=$(dpkg --print-architecture)
250 250
251cat <<EOF >> debian/control 251cat <<EOF >> debian/control