summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2008-04-25 17:23:47 +0000
committerCarmelo Amoroso <carmelo.amoroso@st.com>2008-04-25 17:23:47 +0000
commitf28adc8110ff9a24d653f5cc0441898b8e61aa33 (patch)
tree3f8698cf700c3db61a17904ae03bcea58a026d0a
parent64e1c2a5ff56c9f766891d1457e78d57eb252ad7 (diff)
downloaduClibc-alpine-f28adc8110ff9a24d653f5cc0441898b8e61aa33.tar.bz2
uClibc-alpine-f28adc8110ff9a24d653f5cc0441898b8e61aa33.tar.xz
STEP 9: synch extra directory
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
-rw-r--r--extra/Configs/Config.arm10
-rw-r--r--extra/Configs/Config.avr3226
-rw-r--r--extra/config/zconf.hash.c242
-rwxr-xr-xextra/scripts/getent92
-rwxr-xr-xextra/scripts/relinfo.pl78
5 files changed, 132 insertions, 316 deletions
diff --git a/extra/Configs/Config.arm b/extra/Configs/Config.arm
index 7aec08ce2..26e1f3da4 100644
--- a/extra/Configs/Config.arm
+++ b/extra/Configs/Config.arm
@@ -107,6 +107,16 @@ config CONFIG_ARM1176JZF_S
bool "Arm 1176JZF-S"
select ARCH_HAS_MMU
+config CONFIG_ARM_CORTEX_M3
+ bool "Arm Cortex-M3"
+ select ARCH_HAS_NO_MMU
+ select USE_BX
+
+config CONFIG_ARM_CORTEX_M1
+ bool "Arm Cortex-M1"
+ select ARCH_HAS_NO_MMU
+ select USE_BX
+
config CONFIG_ARM_SA110
bool "Intel StrongArm SA-110"
select ARCH_HAS_MMU
diff --git a/extra/Configs/Config.avr32 b/extra/Configs/Config.avr32
index 0706e7ff9..8d70e6e99 100644
--- a/extra/Configs/Config.avr32
+++ b/extra/Configs/Config.avr32
@@ -4,28 +4,28 @@
#
config TARGET_ARCH
- string
- default "avr32"
+ string
+ default "avr32"
config FORCE_OPTIONS_FOR_ARCH
- bool
- default y
- select ARCH_BIG_ENDIAN
- select FORCE_SHAREABLE_TEXT_SEGMENTS
+ bool
+ default y
+ select ARCH_BIG_ENDIAN
+ select FORCE_SHAREABLE_TEXT_SEGMENTS
config ARCH_CFLAGS
- string
+ string
choice
- prompt "Target CPU Type"
- default CONFIG_AVR32_AP7
+ prompt "Target CPU Type"
+ default CONFIG_AVR32_AP7
config CONFIG_AVR32_AP7
- bool "AVR32 AP7"
- select ARCH_HAS_MMU
+ bool "AVR32 AP7"
+ select ARCH_HAS_MMU
endchoice
config LINKRELAX
- bool "Enable linker optimizations"
- default y
+ bool "Enable linker optimizations"
+ default y
diff --git a/extra/config/zconf.hash.c b/extra/config/zconf.hash.c
deleted file mode 100644
index 47c8b5bab..000000000
--- a/extra/config/zconf.hash.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/* ANSI-C code produced by gperf version 3.0.1 */
-/* Command-line: gperf */
-/* Computed positions: -k'1,3' */
-
-#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
- && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
- && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
- && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
- && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
- && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
- && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
- && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
- && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
- && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
- && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
- && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
- && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
- && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
- && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
- && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
- && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
- && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
- && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
- && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
- && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
- && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
- && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
-/* The character set is not based on ISO-646. */
-#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
-#endif
-
-struct kconf_id;
-/* maximum key range = 45, duplicates = 0 */
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static unsigned int
-kconf_id_hash (register const char *str, register unsigned int len)
-{
- static unsigned char asso_values[] =
- {
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 25, 30, 15,
- 0, 15, 0, 47, 5, 15, 47, 47, 30, 20,
- 5, 0, 25, 15, 0, 0, 10, 35, 47, 47,
- 5, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47
- };
- register int hval = len;
-
- switch (hval)
- {
- default:
- hval += asso_values[(unsigned char)str[2]];
- /*FALLTHROUGH*/
- case 2:
- case 1:
- hval += asso_values[(unsigned char)str[0]];
- break;
- }
- return hval;
-}
-
-struct kconf_id_strings_t
- {
- char kconf_id_strings_str2[sizeof("on")];
- char kconf_id_strings_str6[sizeof("string")];
- char kconf_id_strings_str7[sizeof("default")];
- char kconf_id_strings_str8[sizeof("def_bool")];
- char kconf_id_strings_str10[sizeof("range")];
- char kconf_id_strings_str11[sizeof("def_boolean")];
- char kconf_id_strings_str12[sizeof("def_tristate")];
- char kconf_id_strings_str13[sizeof("hex")];
- char kconf_id_strings_str14[sizeof("defconfig_list")];
- char kconf_id_strings_str16[sizeof("option")];
- char kconf_id_strings_str17[sizeof("if")];
- char kconf_id_strings_str18[sizeof("optional")];
- char kconf_id_strings_str20[sizeof("endif")];
- char kconf_id_strings_str21[sizeof("choice")];
- char kconf_id_strings_str22[sizeof("endmenu")];
- char kconf_id_strings_str23[sizeof("requires")];
- char kconf_id_strings_str24[sizeof("endchoice")];
- char kconf_id_strings_str26[sizeof("config")];
- char kconf_id_strings_str27[sizeof("modules")];
- char kconf_id_strings_str28[sizeof("int")];
- char kconf_id_strings_str29[sizeof("menu")];
- char kconf_id_strings_str31[sizeof("prompt")];
- char kconf_id_strings_str32[sizeof("depends")];
- char kconf_id_strings_str33[sizeof("tristate")];
- char kconf_id_strings_str34[sizeof("bool")];
- char kconf_id_strings_str35[sizeof("menuconfig")];
- char kconf_id_strings_str36[sizeof("select")];
- char kconf_id_strings_str37[sizeof("boolean")];
- char kconf_id_strings_str39[sizeof("help")];
- char kconf_id_strings_str41[sizeof("source")];
- char kconf_id_strings_str42[sizeof("comment")];
- char kconf_id_strings_str43[sizeof("mainmenu")];
- char kconf_id_strings_str46[sizeof("enable")];
- };
-static struct kconf_id_strings_t kconf_id_strings_contents =
- {
- "on",
- "string",
- "default",
- "def_bool",
- "range",
- "def_boolean",
- "def_tristate",
- "hex",
- "defconfig_list",
- "option",
- "if",
- "optional",
- "endif",
- "choice",
- "endmenu",
- "requires",
- "endchoice",
- "config",
- "modules",
- "int",
- "menu",
- "prompt",
- "depends",
- "tristate",
- "bool",
- "menuconfig",
- "select",
- "boolean",
- "help",
- "source",
- "comment",
- "mainmenu",
- "enable"
- };
-#define kconf_id_strings ((const char *) &kconf_id_strings_contents)
-#ifdef __GNUC__
-__inline
-#endif
-struct kconf_id *
-kconf_id_lookup (register const char *str, register unsigned int len)
-{
- enum
- {
- TOTAL_KEYWORDS = 33,
- MIN_WORD_LENGTH = 2,
- MAX_WORD_LENGTH = 14,
- MIN_HASH_VALUE = 2,
- MAX_HASH_VALUE = 46
- };
-
- static struct kconf_id wordlist[] =
- {
- {-1}, {-1},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_ON, TF_PARAM},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6, T_TYPE, TF_COMMAND, S_STRING},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_DEFAULT, TF_COMMAND, S_UNKNOWN},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_DEFAULT, TF_COMMAND, S_BOOLEAN},
- {-1},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10, T_RANGE, TF_COMMAND},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11, T_DEFAULT, TF_COMMAND, S_BOOLEAN},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_TRISTATE},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_TYPE, TF_COMMAND, S_HEX},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_OPT_DEFCONFIG_LIST,TF_OPTION},
- {-1},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_OPTION, TF_COMMAND},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_IF, TF_COMMAND|TF_PARAM},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_OPTIONAL, TF_COMMAND},
- {-1},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str20, T_ENDIF, TF_COMMAND},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_CHOICE, TF_COMMAND},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_ENDMENU, TF_COMMAND},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_REQUIRES, TF_COMMAND},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str24, T_ENDCHOICE, TF_COMMAND},
- {-1},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str26, T_CONFIG, TF_COMMAND},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_TYPE, TF_COMMAND, S_INT},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND},
- {-1},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_PROMPT, TF_COMMAND},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_DEPENDS, TF_COMMAND},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_TYPE, TF_COMMAND, S_TRISTATE},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str34, T_TYPE, TF_COMMAND, S_BOOLEAN},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_MENUCONFIG, TF_COMMAND},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_SELECT, TF_COMMAND},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_TYPE, TF_COMMAND, S_BOOLEAN},
- {-1},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str39, T_HELP, TF_COMMAND},
- {-1},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_SOURCE, TF_COMMAND},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str42, T_COMMENT, TF_COMMAND},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str43, T_MAINMENU, TF_COMMAND},
- {-1}, {-1},
- {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_SELECT, TF_COMMAND}
- };
-
- if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
- {
- register int key = kconf_id_hash (str, len);
-
- if (key <= MAX_HASH_VALUE && key >= 0)
- {
- register int o = wordlist[key].name;
- if (o >= 0)
- {
- register const char *s = o + kconf_id_strings;
-
- if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
- return &wordlist[key];
- }
- }
- }
- return 0;
-}
-
diff --git a/extra/scripts/getent b/extra/scripts/getent
index 03b5f28a9..30d515b7e 100755
--- a/extra/scripts/getent
+++ b/extra/scripts/getent
@@ -1,73 +1,43 @@
#!/bin/sh
+# $Header: /var/cvs/uClibc/extra/scripts/getent,v 1.2 2005/02/02 14:18:01 solar Exp $
#
-# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+# Closely (not perfectly) emulate the behavior of glibc's getent utility
#
-# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-#
-
-# Script to replicate the `getent` binary that comes with glibc
+#passwd|shadow|group|aliases|hosts|networks|ethers|netgroup|protocols|services|rpc
+# only returns the first match (by design)
+# dns based search is not supported (hosts,networks)
+# case-insensitive matches not supported (ethers; others?)
+# may return false-positives (hosts,protocols,rpc,services,ethers)
-search_entry() {
- if [ -e "$1" ] ; then
- /bin/egrep -v "^#" $1 | /bin/sed 's/#.*$//' | /bin/egrep "${string}" | /bin/sed -n 1p
- retval=$?
- [ "$retval" = 0 ] || retval=2
- else
- retval=2
- fi
-}
-
-if [ -z "$1" ] ; then
- echo "getent: wrong number of arguments" 1>&2
- exit 1
-fi
+export PATH="${PATH}:/bin:/usr/bin"
file="/etc/$1"
-string="dummy"
+case $1 in
+ passwd|group)
+ match="^$2:\|^[^:]*:[^:]*:$2:" ;;
+ shadow)
+ match="^$2:" ;;
+ networks|netgroup)
+ match="^[[:space:]]*$2\>" ;;
+ hosts|protocols|rpc|services|ethers)
+ match="\<$2\>" ;;
+ aliases)
+ match="^[[:space:]]*$2[[:space:]]*:" ;;
+ ""|-h|--help)
+ echo "USAGE: $0 database [key]"
+ exit 0 ;;
+ *)
+ echo "$0: Unknown database: $1" 1>&2
+ exit 1 ;;
+esac
if [ ! -f "$file" ] ; then
- echo "Unknown database: $1" 1>&2
- exit 1
+ echo "$0: Could not find database file for $1" 1>&2
+ exit 1
fi
-#aliases|ethers|group|hosts|netgroup|networks|passwd|protocols|rpc|services|shadow)
-# dns based search is not supported for hosts|networks
-# ethers|netgroup (not done, needed)?
-# it returns only the first match
-case $1 in
- passwd)
- string="(^\<$2\>:|^.*:.*:\<$2\>:.*:.*:.*:.*)"
- ;;
- group)
- string="(^|:)\<$2\>:"
- ;;
- shadow)
- string="^\<$2\>:"
- ;;
- aliases)
- if [ -f /etc/postfix/aliases ] ; then
- file="/etc/postfix/aliases"
- elif [ -f /etc/mail/aliases ] ; then
- file="/etc/mail/aliases"
- fi
- string="^\<$2\>:"
- ;;
- networks)
- string="^\<$2\>"
- ;;
- hosts|protocols|rpc|services)
- string="\<$2\>"
- ;;
- *)
- echo "Unknown database: $1"
- exit 1
- ;;
-esac
-
-if [ -z "$2" ] ; then
- exec cat $file
+if [ $# -eq 1 ] ; then
+ exec cat "$file"
else
- search_entry "$file" "$2"
+ sed "s/#.*//; /$match/q; d" "$file" | grep . || exit 2
fi
-
-exit $retval
diff --git a/extra/scripts/relinfo.pl b/extra/scripts/relinfo.pl
new file mode 100755
index 000000000..ec4a5df13
--- /dev/null
+++ b/extra/scripts/relinfo.pl
@@ -0,0 +1,78 @@
+#! /usr/bin/perl
+eval "exec /usr/bin/perl -S $0 $*"
+ if 0;
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc.
+# Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+for ($cnt = 0; $cnt <= $#ARGV; ++$cnt) {
+ $relent = 0;
+ $relsz = 0;
+ $relcount = 0;
+ $pltrelsz = 0;
+ $extplt = 0;
+ $users = 0;
+
+ open (READLINK, "readlink -f $ARGV[$cnt] |") || die "cannot open readlink";
+ while (<READLINK>) {
+ chop;
+ $fullpath = $_;
+ }
+ close (READLINK);
+
+ open (READELF, "eu-readelf -d $ARGV[$cnt] |") || die "cannot open $ARGV[$cnt]";
+ while (<READELF>) {
+ chop;
+ if (/.* RELA?ENT *([0-9]*).*/) {
+ $relent = $1 + 0;
+ } elsif (/.* RELA?SZ *([0-9]*).*/) {
+ $relsz = $1 + 0;
+ } elsif (/.* RELA?COUNT *([0-9]*).*/) {
+ $relcount = $1 + 0;
+ } elsif (/.* PLTRELSZ *([0-9]*).*/) {
+ $pltrelsz = $1 + 0;
+ }
+ }
+ close (READELF);
+
+ open (READELF, "eu-readelf -r $ARGV[$cnt] | sed '/'.gnu.conflict'/,/^\$/d' |") || die "cannot open $ARGV[$cnt]";
+ while (<READELF>) {
+ chop;
+ if (/.*JU?MP_SLOT *0+ .*/) {
+ ++$extplt;
+ }
+ }
+ close (READELF);
+
+ if (open (PRELINK, "/usr/sbin/prelink -p 2>/dev/null | fgrep \"$fullpath\" |")) {
+ while (<PRELINK>) {
+ ++$users;
+ }
+ close(PRELINK);
+ } else {
+ $users = -1;
+ }
+
+ printf ("%s: %d relocations, %d relative (%d%%), %d PLT entries, %d for local syms (%d%%)",
+ $ARGV[$cnt], $relent == 0 ? 0 : $relsz / $relent, $relcount,
+ $relent == 0 ? 0 : ($relcount * 100) / ($relsz / $relent),
+ $relent == 0 ? 0 : $pltrelsz / $relent,
+ $relent == 0 ? 0 : $pltrelsz / $relent - $extplt,
+ $relent == 0 ? 0 : (($pltrelsz / $relent - $extplt) * 100) / ($pltrelsz / $relent));
+ if ($users >= 0) {
+ printf(", %d users", $users);
+ }
+ printf("\n");
+}