From: <ped...@us...> - 2009-02-05 01:27:19
|
Revision: 1214 http://cegcc.svn.sourceforge.net/cegcc/?rev=1214&view=rev Author: pedroalves Date: 2009-02-05 01:27:12 +0000 (Thu, 05 Feb 2009) Log Message: ----------- Delete files that have been deleted upstream. Fix up my name in the ChangeLong entry of the previous commit. :-) Modified Paths: -------------- trunk/cegcc/src/binutils/ChangeLog.ce Removed Paths: ------------- trunk/cegcc/src/binutils/bfd/arange-set.c trunk/cegcc/src/binutils/bfd/arange-set.h trunk/cegcc/src/binutils/config/confsubdir.m4 trunk/cegcc/src/binutils/config/mh-armpic trunk/cegcc/src/binutils/config/mh-elfalphapic trunk/cegcc/src/binutils/config/mh-i370pic trunk/cegcc/src/binutils/config/mh-ia64pic trunk/cegcc/src/binutils/config/mh-m68kpic trunk/cegcc/src/binutils/config/mh-papic trunk/cegcc/src/binutils/config/mh-ppcpic trunk/cegcc/src/binutils/config/mh-s390pic trunk/cegcc/src/binutils/config/mh-sparcpic trunk/cegcc/src/binutils/config/mh-x86pic trunk/cegcc/src/binutils/gas/testsuite/gas/ppc/booke_xcoff64.d trunk/cegcc/src/binutils/gas/testsuite/gas/ppc/booke_xcoff64.s trunk/cegcc/src/binutils/ld/sha1.c trunk/cegcc/src/binutils/ld/sha1.h Modified: trunk/cegcc/src/binutils/ChangeLog.ce =================================================================== --- trunk/cegcc/src/binutils/ChangeLog.ce 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/ChangeLog.ce 2009-02-05 01:27:12 UTC (rev 1214) @@ -1,4 +1,4 @@ -2009-02-04 mosfet <fo...@sm...> +2009-02-04 Pedro Alves <ped...@us...> Merge from FSF head. Deleted: trunk/cegcc/src/binutils/bfd/arange-set.c =================================================================== --- trunk/cegcc/src/binutils/bfd/arange-set.c 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/bfd/arange-set.c 2009-02-05 01:27:12 UTC (rev 1214) @@ -1,729 +0,0 @@ -/* DWARF 2 Arange-Set. - Copyright 2007 Free Software Foundation, Inc. - Contributed by Doug Kwan, Google Inc. - - This file is part of BFD. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or (at - your option) any later version. - - 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., 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ - -#include "sysdep.h" -#include "bfd.h" -#include "libiberty.h" -#include "libbfd.h" -#include "arange-set.h" -#include "splay-tree.h" - -/* Implementation of an arange-set. The set is implemented using the - splay tree support in libiberty. The advantage of using this is - that it has been well tested and is relatively simple to use. The - disadvantage is that it is too general and it does not fit our design - exactly. So we waste a bit of memory for unneeded generality and work - around for mis-match between the splay tree API and the arange-set - internals. A specialized implentation of a balanced tree type for - arange-set exclusively may speed up things a little and reduce memory - consumption. Until there is a pressing need, we stick to the splay - tree in libiberty. */ - -struct arange_set_s -{ - /* Splay tree containing aranges. */ - splay_tree ranges; - - /* Lowest address in set. If set is empty, it is ~0. */ - bfd_vma lower_bound; - - /* Highest address in set. If set is empty, it is 0. */ - bfd_vma upper_bound; - - /* TRUE if aranges in this set have values. */ - bfd_boolean value_p; - - /* Function to compare arange values. */ - arange_value_equal_fn value_equal_fn; - - /* Function to copy an arange value. */ - arange_value_copy_fn value_copy_fn; - - /* Function to combine arange values. */ - arange_value_combine_fn value_combine_fn; - - /* Function to delete an arange value. */ - arange_value_delete_fn value_delete_fn; - - /* Function to allocate a piece of memory. */ - arange_set_allocate_fn allocate_fn; - - /* Function to deallocate a piece of memory. */ - arange_set_deallocate_fn deallocate_fn; - - /* Call back data shared by all callbacks. */ - void *data; -}; - -/* Structure for aranges with a value attached. Since a splay tree - node can only hold one value, we need to use the container struct - to store data associated with an arange and have the splay tree value - to be a pointer to this struct. */ - -typedef struct -{ - /* High-pc of an arange. This is different from the DWARF2 semantics that - the high-pc is really the last location in an arange. */ - bfd_vma high; - - /* We need to store a pointer to the set because splay_tree_value_delete - only takes a pointer to the value deleted. If we use a deallocator - that need extra information like a pointer to the memory pool, we need to - look up via the set pointer. This adds one extra pointer per arange. */ - arange_set set; - - /* Value associated with this arange. */ - arange_value_type value; - -} arange_value_container_t; - - - -static void -arange_set_delete_value (arange_set set, arange_value_type value) -{ - if (set->value_delete_fn) - (set->value_delete_fn) (value, set->data); -} - -/* Compare two VMAs as keys of splay tree nodes. */ - -static int -splay_tree_compare_bfd_vmas (splay_tree_key k1, splay_tree_key k2) -{ - if ((bfd_vma) k1 < (bfd_vma) k2) - return -1; - else if ((bfd_vma) k1 > (bfd_vma) k2) - return 1; - - return 0; -} - -/* Default memory allocator and deallocator. */ - -void * -arange_set_allocate (arange_set set, int size) -{ - if (set->allocate_fn) - return (set->allocate_fn) (size, set->data); - - return xmalloc (size); -} - -void -arange_set_deallocate (arange_set set, void *object) -{ - if (set->deallocate_fn) - (set->deallocate_fn) (object, set->data); - else - free (object); -} - -static void -arange_set_delete_value_container (splay_tree_value value) -{ - arange_value_container_t *container; - - container = (arange_value_container_t*) value; - arange_set_delete_value (container->set, container->value); - arange_set_deallocate (container->set, container); -} - -/* Create an arange set. Return the new set of NULL if there is any - error. - - allocate_fn is the memory allocator function of this arange set. If - it is NULL, the default allocator will be used. - - deallocate_fn is the memory deallocator function of this arange set. If - it is NULL, the default allocator will be used. - - value_p specifies whether an arange set supports values. If it is - TURE. Each arange can be associated with a value of type arange_value_type. - If it is FALSE, the following parameters value_equal_fn, value_copy_fn, - value_combine_fn and value_delete_fn will be ignored. - - value_equal_fn is the value equality function. An arange uses it to - check if two values are the same. If it is NULL, the default bit-wise - equality function will be used. - - value_copy_fn is the value copy function. An arange uses it to copy - values of type arange_value_type. If it is NULL, the default bit-wise - copy function will be used. - - value_combine_fn is the value combine function. An arange uses it to - combine values of two identical arange. If it is NULL, the default - constant zero function will be used. - - value_delete_fn is the value deletion function. If it is not NULL, - it will be called when an arange deletes a value. - - data is pointer to an object, which will be passed to all allocate_fn, - deallocate_fn, value_equal_fn, value_copy_fn, value_combine_fn and - value_delete_fn. */ - -arange_set -arange_set_new (arange_set_allocate_fn allocate_fn, - arange_set_deallocate_fn deallocate_fn, - bfd_boolean value_p, - arange_value_equal_fn value_equal_fn, - arange_value_copy_fn value_copy_fn, - arange_value_combine_fn value_combine_fn, - arange_value_delete_fn value_delete_fn, - void *data) -{ - arange_set set; - splay_tree sp; - splay_tree_delete_value_fn fn; - - /* Allocate space for arange structure. */ - set = (arange_set) - (*allocate_fn) (sizeof (struct arange_set_s), data); - if (!set) - return set; - - fn = value_p ? arange_set_delete_value_container : NULL; - sp = splay_tree_new_with_allocator (splay_tree_compare_bfd_vmas, NULL, - fn, allocate_fn, deallocate_fn, - data); - if (!sp) - { - (deallocate_fn) (set, data); - return NULL; - } - - set->ranges = sp; - set->lower_bound = ~0; - set->upper_bound = 0; - set->value_p = value_p; - set->allocate_fn = allocate_fn; - set->deallocate_fn = deallocate_fn; - set->value_equal_fn = value_equal_fn; - set->value_copy_fn = value_copy_fn; - set->value_combine_fn = value_combine_fn; - set->value_delete_fn = value_delete_fn; - set->data = data; - return set; -} - -/* Delete an arange set. */ - -void -arange_set_delete (arange_set set) -{ - splay_tree_delete (set->ranges); - (*set->deallocate_fn) (set, set->data); -} - -/* Return TRUE if and only if arange set is empty. */ - -bfd_boolean -arange_set_empty_p (arange_set set) -{ - return set->lower_bound > set->upper_bound; -} - -/* Accessors for low and high of an arange. - - There is no arange_set_node_set_low since the low address is the - key of the splay tree node. */ - -/* Get the high VMA address of a node. */ - -static bfd_vma -arange_set_node_high (arange_set set, splay_tree_node node) -{ - arange_value_container_t *container; - - if (set->value_p) - { - container = (arange_value_container_t*) node->value; - return container->high; - } - - return (bfd_vma) node->value; -} - -/* Set the high VMA address of a node. */ - -static void -arange_set_node_set_high (arange_set set, splay_tree_node node, bfd_vma address) -{ - arange_value_container_t *container; - - if (set->value_p) - { - container = (arange_value_container_t*) node->value; - container->high = address; - } - else - node->value = (splay_tree_value) address; -} - -/* Get the low VMA address of a node. */ - -static bfd_vma -arange_set_node_low (splay_tree_node node) -{ - return (bfd_vma) node->key; -} - -/* If arange set supports values, return value of an arange; otheriwse - always return 0 so that it appears that all aranges have the same value. */ - -static arange_value_type -arange_set_node_value (arange_set set, splay_tree_node node) -{ - arange_value_container_t *container; - - if (set->value_p) - { - container = (arange_value_container_t*) node->value; - return container->value; - } - - return 0; -} - -/* If arange set supports values, return value of an arange; otheriwse - always return 0 so that it appears that all aranges have the same value. */ - -static void -arange_set_node_set_value (arange_set set, - splay_tree_node node, - arange_value_type value) -{ - arange_value_container_t *container; - - if (set->value_p) - { - container = (arange_value_container_t*) node->value; - container->value = value; - } -} - -/* Return TRUE if and only if arange set supports values. */ - -bfd_boolean -arange_set_has_values_p (arange_set set) -{ - return set->value_p; -} - -/* Copy a value using the value copying function of an arange set. If - the set does not support values or if there is not value copying - function specified, it simply returns the input value. */ - -arange_value_type -arange_set_copy_value (arange_set set, arange_value_type value) -{ - /* If no copy function is specified or set does not support values, - default is bit-wise copy. */ - if (set->value_p && set->value_copy_fn) - return (set->value_copy_fn) (value, set->data); - - return value; -} - -static arange_value_type -arange_set_combine_value (arange_set set, - arange_value_type value1, - arange_value_type value2) -{ - /* If no combine function is specified or set does not support values, - default is returning 0. */ - if (set->value_p && set->value_combine_fn) - return (set->value_combine_fn) (value1, value2, set->data); - - return (arange_value_type) 0; -} - -/* Compares two values for equality. If the arange set does not support values - or if no value equality function is specified, this function simply does - a bit-wise comparison. */ - -bfd_boolean -arange_set_value_equal_p (arange_set set, - arange_value_type value1, - arange_value_type value2) -{ - /* If no equality function is specified or set does not support values, - default is bit-wise comparison. */ - if (set->value_p && set->value_equal_fn) - return (set->value_equal_fn) (value1, value2, set->data); - - return value1 == value2; -} - -/* Check to see if a given address is in an arange set. Return TRUE if the - address is inside one of the aranges. If low_ptr, high_ptr and value_ptr are - used to return lower address, upper address and value associated with a - found arounge. If anyone of them is NULL, the corresponding information - is not returned. For arange set without values, no information is returned - through the pointer value_ptr. */ - -bfd_boolean -arange_set_lookup_address (arange_set set, bfd_vma address, - bfd_vma *low_ptr, bfd_vma *high_ptr, - arange_value_type *value_ptr) -{ - splay_tree_node pred, node; - - if (address < set->lower_bound || address > set->upper_bound) - return FALSE; - - /* Find immediate predecessor. */ - pred = splay_tree_predecessor (set->ranges, (splay_tree_key) address); - if (pred - && arange_set_node_high (set, pred) >= address) - node = pred; - else - /* If the predecessor range does not cover this address, the address - is in the arange set only if itself starts an arange. */ - node = splay_tree_lookup (set->ranges, (splay_tree_key) address); - - if (node) - { - /* Also return arange boundaries if caller supplies pointers. */ - if (low_ptr) - *low_ptr = arange_set_node_low (node); - if (high_ptr) - *high_ptr = arange_set_node_high (set, node); - if (set->value_p && value_ptr) - *value_ptr = arange_set_node_value (set, node); - return TRUE; - } - - return FALSE; -} - -/* Insert an arange [low, high] into a set's splay tree. If the set supports - value, also insert with the given value. Return the inserted node if there - is no error or NULL otherwise. */ - -static splay_tree_node -arange_set_splay_tree_insert (arange_set set, - bfd_vma low, - bfd_vma high, - arange_value_type value) -{ - splay_tree_value sp_value; - arange_value_container_t *container; - - if (set->value_p) - { - int size = sizeof (arange_value_container_t); - void *data = set->ranges->allocate_data; - - container = - (arange_value_container_t*) (*set->ranges->allocate) (size, data); - if (!container) - return NULL; - container->high = high; - - /* Due to the design of splay tree API, there is no way of passing - callback data to the splay tree value delete function. Hence we need - to store a pointer to set in every containier! */ - container->set = set; - - container->value = value; - sp_value = (splay_tree_value) container; - } - else - sp_value = (splay_tree_value) high; - - /* Currently splay_tree_insert does not return any status to tell if there - is an error. */ - return splay_tree_insert (set->ranges, (splay_tree_key) low, sp_value); -} - -/* Split [low, high] to [low, address) & [address, high]. */ - -static bfd_boolean -arange_set_split_node (arange_set set, splay_tree_node node, bfd_vma address) -{ - splay_tree_node node2; - arange_value_type value; - bfd_vma low, high; - - low = arange_set_node_low (node); - high = arange_set_node_high (set, node); - - BFD_ASSERT (low < address && address <= high); - - value = arange_set_copy_value (set, arange_set_node_value (set, node)); - node2 = arange_set_splay_tree_insert (set, address, high, value); - if (!node2) - return FALSE; - - arange_set_node_set_high (set, node, address - 1); - return TRUE; -} - -static splay_tree_node -arange_set_maybe_merge_with_predecessor (arange_set set, splay_tree_node node) -{ - splay_tree_node pred; - bfd_vma low, high; - - low = arange_set_node_low (node); - high = arange_set_node_high (set, node); - - pred = splay_tree_predecessor (set->ranges, low); - if (! pred) - return node; - - if (arange_set_node_high (set, pred) + 1 == low - && arange_set_value_equal_p (set, - arange_set_node_value (set, pred), - arange_set_node_value (set, node))) - { - splay_tree_remove (set->ranges, arange_set_node_low (node)); - arange_set_node_set_high (set, pred, high); - return arange_set_maybe_merge_with_predecessor (set, pred); - } - - return node; -} - -/* Insert an arange [low,high] into a set. Return TRUE if and only if there - is no error. Note that the address high is also included where as in - DWARF2 an address range between low & high means [low,high). - - This only handles sets with values. For the simpler case of sets without - value, it is handled in arange_set_insert(). This function is - tail-recurive. It is guaranteed to terminate because it only recurses - with a smaller range than it is given. */ - -static bfd_boolean -arange_set_insert_value (arange_set set, - bfd_vma low, - bfd_vma high, - arange_value_type value) -{ - splay_tree_node succ, pred, node; - bfd_vma succ_high, succ_low; - arange_value_type combined, old_value; - - if (low > high) - { - arange_set_delete_value (set, value); - return FALSE; - } - - pred = splay_tree_predecessor (set->ranges, low); - if (pred && arange_set_node_high (set, pred) >= low) - arange_set_split_node (set, pred, low); - - node = splay_tree_lookup (set->ranges, low); - if (node) - { - /* Split node if its arange is larger than inserted arange. */ - if (arange_set_node_high (set, node) > high) - arange_set_split_node (set, node, high + 1); - - old_value = arange_set_node_value (set, node); - combined = arange_set_combine_value (set, old_value, value); - arange_set_node_set_value (set, node, combined); - node = arange_set_maybe_merge_with_predecessor (set, node); - arange_set_delete_value (set, old_value); - - /* Insert remaining arange by tail-recursion. */ - if (high > arange_set_node_high (set, node)) - return arange_set_insert_value (set, - arange_set_node_high (set, node) + 1, - high, value); - else - { - /* Node must cover exactly the range. */ - BFD_ASSERT (high == arange_set_node_high (set, node)); - arange_set_delete_value (set, value); - succ = splay_tree_successor (set->ranges, arange_set_node_low (node)); - if (succ) - succ = arange_set_maybe_merge_with_predecessor (set, succ); - return TRUE; - } - } - - succ = splay_tree_successor (set->ranges, low); - if (succ) - { - succ_low = arange_set_node_low (succ); - succ_high = arange_set_node_high (set, succ); - - if (succ_low <= high) - { - node = arange_set_splay_tree_insert (set, low, succ_low - 1, value); - if (!node) - return FALSE; - - /* Update set lower bound only after insertion is successful. */ - if (low < set->lower_bound) - set->lower_bound = low; - - node = arange_set_maybe_merge_with_predecessor (set, node); - - /* Recurse to handle rest of insertion. Note that we have to copy - value here since it has already been used in the node above. */ - return arange_set_insert_value (set, succ_low, high, - arange_set_copy_value (set, value)); - } - } - - node = arange_set_splay_tree_insert (set, low, high, value); - if (!node) - return FALSE; - - /* Update set boundaries only after insertion is successful. */ - if (low < set->lower_bound) - set->lower_bound = low; - if (high > set->upper_bound) - set->upper_bound = high; - - node = arange_set_maybe_merge_with_predecessor (set, node); - - succ = splay_tree_successor (set->ranges, arange_set_node_low (node)); - if (succ) - succ = arange_set_maybe_merge_with_predecessor (set, succ); - - return TRUE; -} - -bfd_boolean -arange_set_insert (arange_set set, - bfd_vma low, - bfd_vma high, - arange_value_type value) -{ - splay_tree tree = set->ranges; - splay_tree_node pred, succ, node = NULL; - bfd_vma pred_high, node_low; - - if (set->value_p) - return arange_set_insert_value (set, low, high, value); - - if (low > high) - return FALSE; - - pred = splay_tree_predecessor (tree, low); - if (pred) - { - pred_high = arange_set_node_high (set, pred); - - /* Nothing to be done if predecessor contains new aranges. */ - if (pred_high >= high) - return TRUE; - - /* If we can expand predecessor, do so. Test for the case in which - predecessor does not contain new arange but touches it. */ - if (pred_high >= low || pred_high + 1 == low) - { - node = pred; - arange_set_node_set_high (set, node, high); - } - } - - /* Try to see if [low,something] is already in splay tree. */ - if (node == NULL) - { - node = splay_tree_lookup (tree, low); - if (node) - { - /* Nothing to be done if node contains new aranges. */ - if (arange_set_node_high (set, node) >= high) - return TRUE; - - arange_set_node_set_high (set, node, high); - } - } - - if (node == NULL) - { - node = arange_set_splay_tree_insert (set, low, high, 0); - if (!node) - return FALSE; - } - - BFD_ASSERT (node - && arange_set_node_low (node) <= low - && arange_set_node_high (set, node) >= high); - - /* Update set upper and lower bounds. */ - if (low < set->lower_bound) - set->lower_bound = low; - if (high > set->upper_bound) - set->upper_bound = high; - - /* Merge successor if it overlaps or touches node. */ - node_low = arange_set_node_low (node); - while ((succ = splay_tree_successor (tree, node_low)) != NULL - && ((arange_set_node_high (set, node) >= arange_set_node_low (succ)) - || (arange_set_node_high (set, node) + 1 - == arange_set_node_low (succ)))) - { - if (arange_set_node_high (set, succ) > high) - arange_set_node_set_high (set, node, arange_set_node_high (set, succ)); - splay_tree_remove (tree, arange_set_node_low (succ)); - } - return TRUE; -} - -struct arange_set_foreach_adapter_data -{ - void *data; - arange_set set; - arange_set_foreach_fn foreach_fn; -}; - -/* Adaptor to make arange_set_foreach works with splay_tree_foreach. */ - -static int -arange_set_foreach_adapter (splay_tree_node node, void *data) -{ - struct arange_set_foreach_adapter_data *adapter_data; - arange_set set; - - adapter_data = data; - set = adapter_data->set; - return (adapter_data->foreach_fn) (arange_set_node_low (node), - arange_set_node_high (set, node), - arange_set_node_value (set, node), - adapter_data->data); -} - -/* Traverse aranges in a set. For each arange in ascending order of - low addresses, call foreach_fn with arange boundaries and data. - If any invocation of foreach_fn returns a non-zero value, stop traversal - and return that value. Otherwise, return 0. */ - -int -arange_set_foreach (arange_set set, - arange_set_foreach_fn foreach_fn, - void *data) -{ - struct arange_set_foreach_adapter_data adapter_data; - - adapter_data.data = data; - adapter_data.foreach_fn = foreach_fn; - adapter_data.set = set; - return splay_tree_foreach (set->ranges, arange_set_foreach_adapter, - (void *) &adapter_data); -} Deleted: trunk/cegcc/src/binutils/bfd/arange-set.h =================================================================== --- trunk/cegcc/src/binutils/bfd/arange-set.h 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/bfd/arange-set.h 2009-02-05 01:27:12 UTC (rev 1214) @@ -1,187 +0,0 @@ -/* DWARF 2 Arange-Set. - Copyright 2007 Free Software Foundation, Inc. - Contributed by Doug Kwan, Google Inc. - - This file is part of BFD. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or (at - your option) any later version. - - 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., 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ - -/* Scalable DWARF2 Arange Set. - - The original code in dwarf2.c uses an unsorted singly-linked list to - represent aranges in a compilation unit. Looking up for an address - became very in-efficient for extremely large binaries with many - compilation units, each of which having long list of aranges. - - The arange-set implemented here supports insertion and address - containment queries for an arbitrary large collection of aranges in - an efficient manner. In addition, it also supports aranges with - values. - - Arange insertion with value. - - For valued arange-set, we need to specify 4 operations during set - creation. If unspecified, reasonable default behaviours are assumed. - The operations define how arange insertion merges two identical aranges - with different values. The 4 operations are: - - Equality - Copy - Combination - Deletion - - When arange_set_insert () inserts an arange. It breaks the to-be-inserted - arange into smaller aranges using the boundaries of any overlapping - aranges as cutting point. In addition, arange_set_insert () may also - splilt any existing arange that overlap the ends of the to-be-inserted - arange. After such splitting of the new and existing aranges, the - to-be-inserted arange becomes a collection of smaller aranges, each of - which either does not overlapping with any existing arange or overlapping - completely with one existing arange. While splitting aranges, values - are copied using the Copy operation specified in the set. - - The for each smaller new arange, arange_set_insert () inserts the new - arange according to these rules: - - 1. If there is no overlapping existing arange, insert new arange. - - 2. If there is an overlapping existing arange and its value equals - to the inserted value according to the value equality operation - of the set, do nothing. - - 3. If there is an overlapping existing arange and its value is not - the inserted value according to the value equality operation, - combine the inserted value with that of the existing arange using - the value combination operation of set. - - If as a result of insertion, there are adjacent aranges with equal values, - the adjacent aranges will be merge. */ - -#ifndef ARANGE_SET_H -#define ARANGE_SET_H - -#include "sysdep.h" -#include "bfd.h" - -/* An arange_set is a pointer to an arange_set_s struct, whose implementation - is opaque to clients using the arange set. */ -typedef struct arange_set_s *arange_set; - -#ifndef _WIN64 - typedef unsigned long int arange_set_uhostptr_t; -#else - typedef unsigned long long arange_set_uhostptr_t; -#endif - -/* Type of value attached to an arange. This should be wide enough to be - converted from and back to any type without loss. */ -typedef arange_set_uhostptr_t arange_value_type; - -/* Type of function that is used to allocate memory for an arange-set. */ -typedef void* (*arange_set_allocate_fn)(int, void*); - -/* Type of function that is used to deallocate memory of an arange-set. */ -typedef void (*arange_set_deallocate_fn)(void*, void*); - -/* Type of function that is called for each arange during a traversal of - the set containing that arange. */ -typedef int (*arange_set_foreach_fn)(bfd_vma, bfd_vma, arange_value_type, - void *); - -/* Type of function that is called to test equality of range values. */ -typedef bfd_boolean (*arange_value_equal_fn)(arange_value_type, - arange_value_type, void *); - -/* Type of function that is called to copy a range value. */ -typedef arange_value_type (*arange_value_copy_fn)(arange_value_type, void *); - -/* Type of function that is called to combine two range values. */ -typedef arange_value_type (*arange_value_combine_fn)(arange_value_type, - arange_value_type, - void *); - -/* Type of function that is called to delete a range value. */ -typedef void (*arange_value_delete_fn)(arange_value_type, void *); - -/* Create an arange set. Return the new set of NULL if there is any - error. */ -extern arange_set arange_set_new (arange_set_allocate_fn, - arange_set_deallocate_fn, - bfd_boolean, - arange_value_equal_fn, - arange_value_copy_fn, - arange_value_combine_fn, - arange_value_delete_fn, - void *); - -/* Delete an arange set. */ -extern void arange_set_delete (arange_set); - -/* Return TRUE if an only if arange set is empty. */ -extern bfd_boolean arange_set_empty_p (arange_set); - -/* Check to see if a given address is in an arange set. Return TRUE if the - address is inside one of the aranges and if also low_ptr and high_ptr are - not NULL, return the boundaries of the arange. - - If the address is not in any arange in set, return FALSE. */ -extern bfd_boolean arange_set_lookup_address (arange_set, bfd_vma, bfd_vma *, - bfd_vma *, arange_value_type *); - -/* Insert an arange [low,high] into a set. Note that the address high is - also included where as in DWARF2 an address range between low & high means - [low,high). - - If the set is created with no capability of storing values, the value - argument is ignored. Otherwise, the value is stored in the inserted range. - If there are overlapping ranges, values are combined according to - value_combine_fn. - - If value is an object, arange_set_insert () takes ownership of that objec. - Caller should not deallocate objects that are passed to arange_set_insert(). - - Return TRUE if and only if there is no error. */ -extern bfd_boolean arange_set_insert (arange_set, bfd_vma, bfd_vma, - arange_value_type); - -/* Return TRUE if and only if arange set supports arang evalues. */ -extern bfd_boolean arange_set_has_values_p (arange_set); - -/* Traverse aranges in a set. For each arange in ascending order of - low addresses, call foreach_fn with arange boundaries and data. - If any invocation of foreach_fn returns a non-zero value, stop traversal - and return that value. Otherwise, return 0. */ -extern int arange_set_foreach (arange_set, arange_set_foreach_fn, void *); - -/* Return TRUE if two values are considered equal by the value comparison - function of an arange_set. If the arange set does not support values or - if it has no value equality function specified, this function performs - a bit-wise comparison of its input. */ -extern bfd_boolean arange_set_value_equal_p (arange_set, arange_value_type, - arange_value_type); - -/* Duplicate a value. If the arange set does not support values or if it - has no value copying function specified, this function returns the input - value. */ -extern arange_value_type arange_set_copy_value (arange_set, arange_value_type); - -/* Allocate memory using the allocator of an arange set. */ -extern void * arange_set_allocate (arange_set, int); - -/* Deallocate memory allocated from arange_set_allocate (). */ -extern void arange_set_deallocate (arange_set, void *); - -#endif /* ARANGE_SET_H */ Deleted: trunk/cegcc/src/binutils/config/confsubdir.m4 =================================================================== --- trunk/cegcc/src/binutils/config/confsubdir.m4 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/config/confsubdir.m4 2009-02-05 01:27:12 UTC (rev 1214) @@ -1,127 +0,0 @@ -dnl Fix Autoconf-2.59 AC_CONFIG_SUBDIRS whitespace mangling, -dnl by overriding the broken internal Autoconf macro with a -dnl backport of the 2.60 fix. -dnl -dnl This file should be a no-op for Autoconf versions != 2.59. -dnl It can be removed once the complete tree has moved to a -dnl newer Autoconf version. - -dnl m4_PACKAGE_VERSION is an undocumented Autoconf macro. -dnl We use it because this fix is intended for 2.59 only. -dnl A feature test for the broken AC_CONFIG_SUBDIRS instead -dnl would be better but is tricky. -dnl -dnl Use ifdef/ifelse over m4_ifdef/m4_ifelse to be clean for 2.13. -dnl Redefine AC_CONFIG_SUBDIRS so aclocal pulls in this file -dnl when needed. - -ifdef([m4_PACKAGE_VERSION], -[ifelse(m4_PACKAGE_VERSION, [2.59], [ - -dnl Redefine AC_CONFIG_SUBDIRS so this file is picked up if needed. -AC_DEFUN([AC_CONFIG_SUBDIRS], defn([AC_CONFIG_SUBDIRS])) - -dnl Override the broken macro. -# _AC_OUTPUT_SUBDIRS -# ------------------ -# This is a subroutine of AC_OUTPUT, but it does not go into -# config.status, rather, it is called after running config.status. -m4_define([_AC_OUTPUT_SUBDIRS], -[ -# -# CONFIG_SUBDIRS section, as fixed in confsubdir.m4. -# -if test "$no_recursion" != yes; then - - # Remove --cache-file and --srcdir arguments so they do not pile up. - ac_sub_configure_args= - ac_prev= - eval "set x $ac_configure_args" - shift - for ac_arg - do - if test -n "$ac_prev"; then - ac_prev= - continue - fi - case $ac_arg in - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ - | --c=*) - ;; - --config-cache | -C) - ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - ;; - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - ;; - *) - case $ac_arg in - *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;; - esac - done - - # Always prepend --prefix to ensure using the same prefix - # in subdir configurations. - ac_arg="--prefix=$prefix" - case $ac_arg in - *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - ac_sub_configure_args="$ac_arg $ac_sub_configure_args" - - ac_popdir=`pwd` - for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue - - # Do not complain, so a configure script can configure whichever - # parts of a large source tree are present. - test -d "$srcdir/$ac_dir" || continue - - AC_MSG_NOTICE([configuring in $ac_dir]) - AS_MKDIR_P(["$ac_dir"]) - _AC_SRCPATHS(["$ac_dir"]) - - cd "$ac_dir" - - # Check for guested configure; otherwise get Cygnus style configure. - if test -f "$ac_srcdir/configure.gnu"; then - ac_sub_configure=$ac_srcdir/configure.gnu - elif test -f "$ac_srcdir/configure"; then - ac_sub_configure=$ac_srcdir/configure - elif test -f "$ac_srcdir/configure.in"; then - # This should be Cygnus configure. - ac_sub_configure=$ac_aux_dir/configure - else - AC_MSG_WARN([no configuration information is in $ac_dir]) - ac_sub_configure= - fi - - # The recursion is here. - if test -n "$ac_sub_configure"; then - # Make the cache file name correct relative to the subdirectory. - case $cache_file in - [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;; - *) # Relative path. - ac_sub_cache_file=$ac_top_builddir$cache_file ;; - esac - - AC_MSG_NOTICE([running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir]) - # The eval makes quoting arguments work. - eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ - --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || - AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir]) - fi - - cd "$ac_popdir" - done -fi -])# _AC_OUTPUT_SUBDIRS -])]) Deleted: trunk/cegcc/src/binutils/config/mh-armpic =================================================================== --- trunk/cegcc/src/binutils/config/mh-armpic 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/config/mh-armpic 2009-02-05 01:27:12 UTC (rev 1214) @@ -1 +0,0 @@ -PICFLAG=-fPIC Deleted: trunk/cegcc/src/binutils/config/mh-elfalphapic =================================================================== --- trunk/cegcc/src/binutils/config/mh-elfalphapic 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/config/mh-elfalphapic 2009-02-05 01:27:12 UTC (rev 1214) @@ -1 +0,0 @@ -PICFLAG=-fPIC Deleted: trunk/cegcc/src/binutils/config/mh-i370pic =================================================================== --- trunk/cegcc/src/binutils/config/mh-i370pic 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/config/mh-i370pic 2009-02-05 01:27:12 UTC (rev 1214) @@ -1 +0,0 @@ -PICFLAG=-fPIC Deleted: trunk/cegcc/src/binutils/config/mh-ia64pic =================================================================== --- trunk/cegcc/src/binutils/config/mh-ia64pic 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/config/mh-ia64pic 2009-02-05 01:27:12 UTC (rev 1214) @@ -1 +0,0 @@ -PICFLAG=-fpic Deleted: trunk/cegcc/src/binutils/config/mh-m68kpic =================================================================== --- trunk/cegcc/src/binutils/config/mh-m68kpic 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/config/mh-m68kpic 2009-02-05 01:27:12 UTC (rev 1214) @@ -1 +0,0 @@ -PICFLAG=-fpic Deleted: trunk/cegcc/src/binutils/config/mh-papic =================================================================== --- trunk/cegcc/src/binutils/config/mh-papic 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/config/mh-papic 2009-02-05 01:27:12 UTC (rev 1214) @@ -1 +0,0 @@ -PICFLAG=-fPIC Deleted: trunk/cegcc/src/binutils/config/mh-ppcpic =================================================================== --- trunk/cegcc/src/binutils/config/mh-ppcpic 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/config/mh-ppcpic 2009-02-05 01:27:12 UTC (rev 1214) @@ -1 +0,0 @@ -PICFLAG=-fPIC Deleted: trunk/cegcc/src/binutils/config/mh-s390pic =================================================================== --- trunk/cegcc/src/binutils/config/mh-s390pic 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/config/mh-s390pic 2009-02-05 01:27:12 UTC (rev 1214) @@ -1 +0,0 @@ -PICFLAG=-fpic Deleted: trunk/cegcc/src/binutils/config/mh-sparcpic =================================================================== --- trunk/cegcc/src/binutils/config/mh-sparcpic 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/config/mh-sparcpic 2009-02-05 01:27:12 UTC (rev 1214) @@ -1 +0,0 @@ -PICFLAG=`case '${LIBCFLAGS} ${LIBCXXFLAGS}' in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac` Deleted: trunk/cegcc/src/binutils/config/mh-x86pic =================================================================== --- trunk/cegcc/src/binutils/config/mh-x86pic 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/config/mh-x86pic 2009-02-05 01:27:12 UTC (rev 1214) @@ -1 +0,0 @@ -PICFLAG=-fpic Deleted: trunk/cegcc/src/binutils/gas/testsuite/gas/ppc/booke_xcoff64.d =================================================================== --- trunk/cegcc/src/binutils/gas/testsuite/gas/ppc/booke_xcoff64.d 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/gas/testsuite/gas/ppc/booke_xcoff64.d 2009-02-05 01:27:12 UTC (rev 1214) @@ -1,125 +0,0 @@ -#as: -a64 -mppc64 -mbooke64 -#objdump: -dr -Mbooke64 -#name: xcoff64 BookE tests - -.*: file format aix5?coff64-rs6000 - -Disassembly of section .text: - -0000000000000000 <.text>: - 0: 7c 22 3f 64 tlbre r1,r2,7 - 4: 7c be 1f a4 tlbwe r5,r30,3 - 8: 24 25 00 30 bce 1,4\*cr1\+gt,38 <.text\+0x38> - c: 24 46 00 3d bcel 2,4\*cr1\+eq,48 <.text\+0x48> - 10: 24 67 00 5a bcea 3,4\*cr1\+so,58 <.text\+0x58> - 12: R_BA_16 .text - 14: 24 88 00 7b bcela 4,4\*cr2\+lt,78 <.text\+0x78> - 16: R_BA_16 .text - 18: 4c a9 00 22 bclre 5,4\*cr2\+gt - 1c: 4c aa 00 23 bclrel 5,4\*cr2\+eq - 20: 4d 0b 04 22 bcctre 8,4\*cr2\+so - 24: 4d 0c 04 23 bcctrel 8,4\*cr3\+lt - 28: 58 00 00 74 be 9c <.text\+0x9c> - 2c: 58 00 00 89 bel b4 <.text\+0xb4> - 30: 58 00 00 f2 bea f0 <.text\+0xf0> - 30: R_BA_26 .text - 34: 58 00 01 27 bela 124 <.text\+0x124> - 34: R_BA_26 .text - 38: e9 09 00 80 lbze r8,8\(r9\) - 3c: e9 8f 00 41 lbzue r12,4\(r15\) - 40: 7c 86 40 fe lbzuxe r4,r6,r8 - 44: 7c 65 38 be lbzxe r3,r5,r7 - 48: f8 a6 06 40 lde r5,400\(r6\) - 4c: f8 c7 07 11 ldue r6,452\(r7\) - 50: 7c e8 4e 3e ldxe r7,r8,r9 - 54: 7d 4b 66 7e lduxe r10,r11,r12 - 58: f9 81 02 06 lfde f12,128\(r1\) - 5c: f8 25 00 47 lfdue f1,16\(r5\) - 60: 7c a1 1c be lfdxe f5,r1,r3 - 64: 7c c2 24 fe lfduxe f6,r2,r4 - 68: f9 09 00 c4 lfse f8,48\(r9\) - 6c: f9 2a 01 15 lfsue f9,68\(r10\) - 70: 7d 44 44 7e lfsuxe f10,r4,r8 - 74: 7d 23 3c 3e lfsxe f9,r3,r7 - 78: e9 45 03 24 lhae r10,50\(r5\) - 7c: e8 23 00 55 lhaue r1,5\(r3\) - 80: 7c a1 1a fe lhauxe r5,r1,r3 - 84: 7f be fa be lhaxe r29,r30,r31 - 88: 7c 22 1e 3c lhbrxe r1,r2,r3 - 8c: e8 83 01 22 lhze r4,18\(r3\) - 90: e8 c9 01 43 lhzue r6,20\(r9\) - 94: 7c a7 4a 7e lhzuxe r5,r7,r9 - 98: 7d 27 2a 3e lhzxe r9,r7,r5 - 9c: 7d 4f a0 fc lwarxe r10,r15,r20 - a0: 7c aa 94 3c lwbrxe r5,r10,r18 - a4: eb 9d 00 46 lwze r28,4\(r29\) - a8: e9 0a 02 87 lwzue r8,40\(r10\) - ac: 7c 66 48 7e lwzuxe r3,r6,r9 - b0: 7f dd e0 3e lwzxe r30,r29,r28 - b4: 7c 06 3d fc dcbae r6,r7 - b8: 7c 08 48 bc dcbfe r8,r9 - bc: 7c 0a 5b bc dcbie r10,r11 - c0: 7c 08 f0 7c dcbste r8,r30 - c4: 7c c3 0a 3c dcbte 6,r3,r1 - c8: 7c a4 11 fa dcbtste 5,r4,r2 - cc: 7c 0f 77 fc dcbze r15,r14 - d0: 7c 03 27 bc icbie r3,r4 - d4: 7c a8 48 2c icbt 5,r8,r9 - d8: 7c ca 78 3c icbte 6,r10,r15 - dc: 7c a6 02 26 mfapidi r5,r6 - e0: 7c 07 46 24 tlbivax r7,r8 - e4: 7c 09 56 26 tlbivaxe r9,r10 - e8: 7c 0b 67 24 tlbsx r11,r12 - ec: 7c 0d 77 26 tlbsxe r13,r14 - f0: 7c 22 1b 14 adde64 r1,r2,r3 - f4: 7c 85 37 14 adde64o r4,r5,r6 - f8: 7c e8 03 d4 addme64 r7,r8 - fc: 7d 2a 07 d4 addme64o r9,r10 - 100: 7d 6c 03 94 addze64 r11,r12 - 104: 7d ae 07 94 addze64o r13,r14 - 108: 7e 80 04 40 mcrxr64 cr5 - 10c: 7d f0 8b 10 subfe64 r15,r16,r17 - 110: 7e 53 a7 10 subfe64o r18,r19,r20 - 114: 7e b6 03 d0 subfme64 r21,r22 - 118: 7e f8 07 d0 subfme64o r23,r24 - 11c: 7f 3a 03 90 subfze64 r25,r26 - 120: 7f 7c 07 90 subfze64o r27,r28 - 124: e8 22 03 28 stbe r1,50\(r2\) - 128: e8 64 02 89 stbue r3,40\(r4\) - 12c: 7c a6 39 fe stbuxe r5,r6,r7 - 130: 7d 09 51 be stbxe r8,r9,r10 - 134: 7d 6c 6b ff stdcxe. r11,r12,r13 - 138: f9 cf 00 78 stde r14,28\(r15\) - 13c: fa 11 00 59 stdue r16,20\(r17\) - 140: 7e 53 a7 3e stdxe r18,r19,r20 - 144: 7e b6 bf 7e stduxe r21,r22,r23 - 148: f8 38 00 3e stfde f1,12\(r24\) - 14c: f8 59 00 0f stfdue f2,0\(r25\) - 150: 7c 7a dd be stfdxe f3,r26,r27 - 154: 7c 9c ed fe stfduxe f4,r28,r29 - 158: 7c be ff be stfiwxe f5,r30,r31 - 15c: f8 de 00 6c stfse f6,24\(r30\) - 160: f8 fd 00 5d stfsue f7,20\(r29\) - 164: 7d 1c dd 3e stfsxe f8,r28,r27 - 168: 7d 3a cd 7e stfsuxe f9,r26,r25 - 16c: 7f 17 b7 3c sthbrxe r24,r23,r22 - 170: ea b4 01 ea sthe r21,30\(r20\) - 174: ea 72 02 8b sthue r19,40\(r18\) - 178: 7e 30 7b 7e sthuxe r17,r16,r15 - 17c: 7d cd 63 3e sthxe r14,r13,r12 - 180: 7d 6a 4d 3c stwbrxe r11,r10,r9 - 184: 7d 07 31 3d stwcxe. r8,r7,r6 - 188: e8 a4 03 2e stwe r5,50\(r4\) - 18c: e8 62 02 8f stwue r3,40\(r2\) - 190: 7c 22 19 7e stwuxe r1,r2,r3 - 194: 7c 85 31 3e stwxe r4,r5,r6 - 198: 4c 00 00 66 rfci - 19c: 7c 60 01 06 wrtee r3 - 1a0: 7c 00 81 46 wrteei 1 - 1a4: 7c 85 02 06 mfdcrx r4,r5 - 1a8: 7c aa 3a 86 mfdcr r5,234 - 1ac: 7c e6 03 06 mtdcrx r6,r7 - 1b0: 7d 10 6b 86 mtdcr 432,r8 - 1b4: 7c 00 04 ac msync - 1b8: 7c 09 55 ec dcba r9,r10 - 1bc: 7c 00 06 ac mbar Deleted: trunk/cegcc/src/binutils/gas/testsuite/gas/ppc/booke_xcoff64.s =================================================================== --- trunk/cegcc/src/binutils/gas/testsuite/gas/ppc/booke_xcoff64.s 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/gas/testsuite/gas/ppc/booke_xcoff64.s 2009-02-05 01:27:12 UTC (rev 1214) @@ -1,136 +0,0 @@ -# Motorola PowerPC BookE tests -#as: -a64 -mppc64 -mbooke64 - .csect .text[PR] - .csect main[DS] -main: - .csect .text[PR] -.main: - tlbre 1, 2, 7 - tlbwe 5, 30, 3 - bce 1, 5, branch_target_1 - bcel 2, 6, branch_target_2 - bcea 3, 7, branch_target_3 - bcela 4, 8, branch_target_4 - bclre 5, 9 - bclrel 5, 10 - bcctre 8, 11 - bcctrel 8, 12 - be branch_target_5 - bel branch_target_6 - bea branch_target_7 - bela branch_target_8 - -branch_target_1: - lbze 8, 8(9) - lbzue 12, 4(15) - lbzuxe 4, 6, 8 - lbzxe 3, 5, 7 - -branch_target_2: - lde 5, 400(6) - ldue 6, 452(7) - ldxe 7, 8, 9 - lduxe 10, 11, 12 - -branch_target_3: - lfde 12, 128(1) - lfdue 1, 16(5) - lfdxe 5, 1, 3 - lfduxe 6, 2, 4 - lfse 8, 48(9) - lfsue 9, 68(10) - lfsuxe 10, 4, 8 - lfsxe 9, 3, 7 - -branch_target_4: - lhae 10, 50(5) - lhaue 1, 5(3) - lhauxe 5, 1, 3 - lhaxe 29, 30, 31 - lhbrxe 1, 2, 3 - lhze 4, 18(3) - lhzue 6, 20(9) - lhzuxe 5, 7, 9 - lhzxe 9, 7, 5 - -branch_target_5: - lwarxe 10, 15, 20 - lwbrxe 5, 10, 18 - lwze 28, 4(29) - lwzue 8, 40(10) - lwzuxe 3, 6, 9 - lwzxe 30, 29, 28 - -branch_target_6: - dcbae 6, 7 - dcbfe 8, 9 - dcbie 10, 11 - dcbste 8, 30 - dcbte 6, 3, 1 - dcbtste 5, 4, 2 - dcbze 15, 14 - icbie 3, 4 - icbt 5, 8, 9 - icbte 6, 10, 15 - mfapidi 5, 6 - tlbivax 7, 8 - tlbivaxe 9, 10 - tlbsx 11, 12 - tlbsxe 13, 14 - -branch_target_7: - adde64 1, 2, 3 - adde64o 4, 5, 6 - addme64 7, 8 - addme64o 9, 10 - addze64 11, 12 - addze64o 13, 14 - mcrxr64 5 - subfe64 15, 16, 17 - subfe64o 18, 19, 20 - subfme64 21, 22 - subfme64o 23, 24 - subfze64 25, 26 - subfze64o 27, 28 - -branch_target_8: - stbe 1, 50(2) - stbue 3, 40(4) - stbuxe 5, 6, 7 - stbxe 8, 9, 10 - stdcxe. 11, 12, 13 - stde 14, 28(15) - stdue 16, 20(17) - stdxe 18, 19, 20 - stduxe 21, 22, 23 - stfde 1, 12(24) - stfdue 2, 0(25) - stfdxe 3, 26, 27 - stfduxe 4, 28, 29 - stfiwxe 5, 30, 31 - stfse 6, 24(30) - stfsue 7, 20(29) - stfsxe 8, 28, 27 - stfsuxe 9, 26, 25 - sthbrxe 24, 23, 22 - sthe 21, 30(20) - sthue 19, 40(18) - sthuxe 17, 16, 15 - sthxe 14, 13, 12 - stwbrxe 11, 10, 9 - stwcxe. 8, 7, 6 - stwe 5, 50(4) - stwue 3, 40(2) - stwuxe 1, 2, 3 - stwxe 4, 5, 6 - - rfci - wrtee 3 - wrteei 1 - mfdcrx 4, 5 - mfdcr 5, 234 - mtdcrx 6, 7 - mtdcr 432, 8 - msync - dcba 9, 10 - mbar 0 Deleted: trunk/cegcc/src/binutils/ld/sha1.c =================================================================== --- trunk/cegcc/src/binutils/ld/sha1.c 2009-02-05 01:21:13 UTC (rev 1213) +++ trunk/cegcc/src/binutils/ld/sha1.c 2009-02-05 01:27:12 UTC (rev 1214) @@ -1,423 +0,0 @@ -/* sha1.c - Functions to compute SHA1 message digest of files or - memory blocks according to the NIST specification FIPS-180-1. - - Copyright (C) 2007 Free Software Foundation, Inc. - - This file is part of the GNU Binutils. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 3, or (at your option) any - later version. - - 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* Written by Scott G. Miller - Credits: - Robert Klep <ro...@il...> -- Expansion function fix */ - -#include <config.h> -#include "sha1.h" -#include <stddef.h> -#include <string.h> - -#if USE_UNLOCKED_IO -# include "unlocked-io.h" -#endif - -#ifdef WORDS_BIGENDIAN -# define SWAP(n) (n) -#else -# define SWAP(n) \ - (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) -#endif - -#define BLOCKSIZE 4096 -#if BLOCKSIZE % 64 != 0 -# error "invalid BLOCKSIZE" -#endif - -/* This array contains the bytes used to pad the buffer to the next - 64-byte boundary. (RFC 1321, 3.1: Step 1) */ -static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; - - -/* Take a pointer to a 160 bit block of data (five 32 bit ints) and - initialize it to the start constants of the SHA1 algorithm. This - must be called before using hash in the call to sha1_hash. */ - -void -sha1_init_ctx (struct sha1_ctx *ctx) -{ - ctx->A = 0x67452301; - ctx->B = 0xefcdab89; - ctx->C = 0x98badcfe; - ctx->D = 0x10325476; - ctx->E = 0xc3d2e1f0; - - ctx->total[0] = ctx->total[1] = 0; - ctx->buflen = 0; -} - -/* Put result from CTX in first 20 bytes following RESBUF. The result - must be in little endian byte order. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32-bit value. */ - -void * -sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf) -{ - ((uint32_t *) resbuf)[0] = SWAP (ctx->A); - ((uint32_t *) resbuf)[1] = SWAP (ctx->B); - ((uint32_t *) resbuf)[2] = SWAP (ctx->C); - ((uint32_t *) resbuf)[3] = SWAP (ctx->D); - ((uint32_t *) resbuf)[4] = SWAP (ctx->E); - - return resbuf; -} - -/* Process the remaining bytes in the internal buffer and the usual - prolog according to the standard and write the result to RESBUF. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32-bit value. */ - -void * -sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf) -{ - /* Take yet unprocessed bytes into account. */ - uint32_t bytes = ctx->buflen; - size_t size = (bytes < 56) ? 64 / 4 : 64 * 2 / 4; - - /* Now count remaining bytes. */ - ctx->total[0] += bytes; - if (ctx->total[0] < bytes) - ++ctx->total[1]; - - /* Put the 64-bit file length in *bits* at the end of the buffer. */ - ctx->buffer[size - 2] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); - ctx->buffer[size - 1] = SWAP (ctx->total[0] << 3); - - memcpy (&((char *) ctx->buffer)[bytes], fillbuf, (size - 2) * 4 - bytes); - - /* Process last bytes. */ - sha1_process_block (ctx->buffer, size * 4, ctx); - - return sha1_read_ctx (ctx, resbuf); -} - -/* Compute SHA1 message digest for bytes read from STREAM. The - resulting message digest number will be written into the 16 bytes - beginning at RESBLOCK. */ - -int -sha1_stream (FILE *stream, void *resblock) -{ - struct sha1_ctx ctx; - char buffer[BLOCKSIZE + 72]; - size_t sum; - - /* Initialize the computation context. */ - sha1_init_ctx (&ctx); - - /* Iterate over full file contents. */ - while (1) - { - /* We read the file in blocks of BLOCKSIZE bytes. One call of the - computation function processes the whole buffer so that with the - next round of the loop another block can be read. */ - size_t n; - sum = 0; - - /* Read block. Take care for partial reads. */ - while (1) - { - n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); - - sum += n; - - if (sum == BLOCKSIZE) - break; - - if (n == 0) - { - /* Check for the error flag IFF N == 0, so that we don't - exit the loop after a partial read due to e.g., EAGAIN - or EWOULDBLOCK. */ - if (ferror (stream)) - return 1; - goto process_partial_block; - } - - /* We've read at least one byte, so ignore errors. But always - check for EOF, since feof may be true even though N > 0. - Otherwise, we could end up calling fread after EOF. */ - if (feof (stream)) - goto process_partial_block; - } - - /* Process buffer with BLOCKSIZE bytes. Note that - BLOCKSIZE % 64 == 0. */ - sha1_process_block (buffer, BLOCKSIZE, &ctx); - } - - process_partial_block:; - - /* Process any remaining bytes. */ - if (sum > 0) - sha1_process_bytes (buffer, sum, &ctx); - - /* Construct result in desired memory. */ - sha1_finish_ctx (&ctx, resblock); - return 0; -} - -/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The - result is always in little endian byte order, so that a byte-wise - output yields to the wanted ASCII representation of the message - digest. */ - -void * -sha1_buffer (const char *buffer, size_t len, void *resblock) -{ - struct sha1_ctx ctx; - - /* Initialize the computation context. */ - sha1_init_ctx (&ctx); - - /* Process whole buffer but last len % 64 bytes. */ - sha1_process_bytes (buffer, len, &ctx); - - /* Put result in desired memory area. */ - return sha1_finish_ctx (&ctx, resblock); -} - -void -sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx) -{ - /* When we already have some bits in our internal buffer concatenate - both inputs first. */ - if (ctx->buflen != 0) - { - size_t left_over = ctx->buflen; - size_t add = 128 - left_over > len ? len : 128 - left_over; - - memcpy (&((char *) ctx->buffer)[left_over], buffer, add); - ctx->buflen += add; - - if (ctx->buflen > 64) - { - sha1_process_block (ctx->buffer, ctx->buflen & ~63, ctx); - - ctx->buflen &= 63; - /* The regions in the following copy operation cannot overlap. */ - memcpy (ctx->buffer, - &((char *) ctx->buffer)[(left_over + add) & ~63], - ctx->buflen); - } - - buffer = (const char *) buffer + add; - len -= add; - } - - /* Process available complete blocks. */ - if (len >= 64) - { -#if !_STRING_ARCH_unaligned -# define alignof(type) offsetof (struct { char c; type x; }, x) -# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0) - if (UNALIGNED_P (buffer)) - while (len > 64) - { - sha1_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); - buffer = (const char *) buffer + 64; - len -= 64; - } - else -#endif - { - sha1_process_block (buffer, len & ~63, ctx); - buffer = (const char *) buffer + (len & ~63); - len &= 63; - } - } - - /* Move remaining bytes in internal buffer. */ - if (len > 0) - { - size_t left_over = ctx->buflen; - - memcpy (&((char *) ctx->buffer)[left_over], buffer, len); - left_over += len; - if (left_over >= 64) - { - sha1_process_block (ctx->buffer, 64, ctx); - left_over -= 64; - memcpy (ctx->buffer, &ctx->buffer[16], left_over); - } - ctx->buflen = left_over; - } -} - -/* --- Code below is the primary difference between md5.c and sha1.c --- */ - -/* SHA1 round constants. */ -#define K1 0x5a827999 -#define K2 0x6ed9eba1 -#define K3 0x8f1bbcdc -#define K4 0xca62c1d6 - -/* Round functions. Note that F2 is the same as F4. */ -#define F1(B,C,D) (D ^ (B & (C ^ D))) -#define F2(B,C,D) (B ^ C ^ D) -#define F3(B,C,D) ((B & C) | (D & (B | C))) -#define F4(B,C,D) (B ^ C ^ D) - -/* Process LEN bytes of BUFFER, accumulating context into CTX. - It is assumed that LEN % 64 == 0. - Most of this code comes from GnuPG's cipher/sha1.c. */ - -void -sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx) -{ - const uint32_t *words = buffer; - size_t nwords = len / sizeof (uint32_t); - const uint32_t *endp = words + nwords; - uint32_t x[16]; - uint32_t a = ctx->A; - uint32_t b = ctx->B; - uint32_t c = ctx->C; - uint32_t d = ctx->D; - uint32_t e = ctx->E; - - /* First increment the byte count. RFC 1321 specifies the possible - length of the file up to 2^64 bits. Here we only compute the - number of bytes. Do a double word increment. */ - ctx->total[0] += len; - if (ctx->total[0] < len) - ++ctx->total[1]; - -#define rol(x, n) (((x) << (n)) | ((uint32_t) (x) >> (32 - (n)))) - -#define M(I) (tm = x[I & 0x0f] ^ x[(I - 14) & 0x0f] \ - ^ x[(I - 8) & 0x0f] ^ x[(I - 3) & 0x0f] \ - , (x[I & 0x0f] = rol (tm, 1))) - -#define R(A,B,C,D,E,F,K,M) \ - do \ - { \ - E += rol (A, 5) \ - + F (B, C, D) \ - + K \ - + M; \ - B = rol (B, 30); \ - } \ - while (0) - - while (words < endp) - { - uint32_t tm; - int t; - - for (t = 0; t < 16; t++) - { - x[t] = SWAP (*words); - words++; - } - - R (a, b, c, d, e, F1, K1, x[ 0]); - R (e, a, b, c, d, F1, K1, x[ 1]); - R (d, e, a, b, c, F1, K1, x[ 2]); - R (c, d, e, a, b, F1, K1, x[ 3]); - R (b, c, d, e, a, F1, K1, x[ 4]); - R (a, b, c, d, e, F1, K1, x[ 5]); - R (e, a, b, c, d, F1, K1, x[ 6]); - R (d, e, a, b, c, F1, K1, x[ 7]); - R (c, d, e, a, b, F1, K1, x[ 8]); - R (b, c, d, e, a, F1, K1, x[ 9]); - R (a, b, c, d, e, F1, K1, x[10]); - R (e, a, b, c, d, F1, K1, x[11]); - R (d, e, a, b, c, F1, K1, x[12]); - R (c, d, e, a, b, F1, K1, x[13]); - R (b, c, d, e, a, F1, K1, x[14]); - R (a, b, c, d, e, F1, K1, x[15]); - R (e, a, b, c, d, F1, K1, M(16)); - R (d, e, a, b, c, F1, K1, M(17)); - R (c, d, e, a, b, F1, K1, M(18)); - R (b, c, d, e, a, F1, K1, M(19)); - R (a, b, c, d, e, F2, K2, M(20)); - R (e, a, b, c, d, F2, K2, M(21)); - R (d, e, a, b, c, F2, K2, M(22)); - R (c, d, e, a, b, F2, K2, M(23)); - R (b, c, d, e, a, F2, K2, M(24)); - R (a, b, c, d, e, F2, K2, M(25)); - R (e, a, b, c, d, F2, K2, M(26)); - R (d, e, a, b, c, F2, K2, M(27)); - R (c, d, e, a, b, F2, K2, M(28)); - R (b, c, d, e, a, F2, K2, M(29)); - R (a, b, c, d, e, F2, K2, M(30)); - R (e, a, b, c, d, F2, K2, M(31)); - R (d, e, a, b, c, F2, K2, M(32)); - R (c, d, e, a, b, F2, K2, M(33)); - R (b, c, d, e, a, F2, K2, M(34)); - R (a, b, c, d, e, F2, K2, M(35)); - R (e, a, b, c, d, F2, K2, M(36)); - R (d, e, a, b, c, F2, K2, M(37)); - R (c, d, e, a, b, F2, K2, M(38)); - R (b, c, d, e, a, F2, K2, M(39)); - R (a, b, c, d, e, F3, K3, M(40)); - R (e, a, b, c, d, F3, K3, M(41)); - R (d, e, a, b, c, F3, K3, M(42)); - R (c, d, e, a, b, F3, K3, M(43)); - R (b, c, d, e, a, F3, K3, M(44)); - R (a, b, c, d, e, F3, K3, M(45)); - R (e, a, b, c, d, F3, K3, M(46)); - R (d, e, a, b, c, F3, K3, M(47)); - R (c, d, e, a, b, F3, K3, M(48)); - R (b, c, d, e, a, F3, K3, M(49)); - R (a, b, c, d, e, F3, K3, M(50)); - R (e, a, b, c, d, F3, K3, M(51)); - R (d, e, a, b, c, F3, K3, M(52)); - R (c, d, e, a, b, F3, K3, M(53)); - R (b, c, d, e, a, F3, K3, M(54)); - R (a, b, c, d, e, F3, K3, M(55)); - R (e, a, b, c, d, F3, K3, M(56)); - R (d, e, a, b, c, F3, K3, M(57)); - R (c, d, e, a, b, F3, K3, M(58)); - R (b, c, d, e, a, F3, K3, M(59)); - R (a, b, c, d, e, F4, K4, M(60)); - R (e, a, b, c, d, F4, K4, M(61)); - R (d, e, a, b, c, F4, K4, M(62)); - R (c, d, e, a, b, F4, K4, M(63)); - R (b, c, d, e, a, F4, K4, M(64)); - R (a, b, c, d, e, F4, K4, M(65)); - R (e, a, b, c, d, F4, K4, M(66)); - R (d, e, a, b, c, F4, K4, M(67)); - R (c, d, e, a, b, F4, K4, M(68)); - R (b, c, d, e, a, F4, K4, M(69)); - R (a, b, c, d, e, F4, K4, M(70)); - R (e, a, b, c, d, F4, K4, M(71)); - R (d, e, a, b, c, F4, K4, M(72)); - R (c, d, e, a, b, F4, K4, M(73)); - R (b, c, d, e, a, F4, K4, M(74)); - R (a, b, c, d, e, F4, K4, M(75)); - R (e, a, b, c, d, F4, K4, M(76)); - R (d, ... [truncated message content] |