There are #ifndef _WIN64 typedef unsigned long int libi_uhostptr_t; typedef long int libi_shostptr_t; #else typedef unsigned long long libi_uhostptr_t; typedef long long libi_shostptr_t; #endif ... /* Use typedefs for the key and data types to facilitate changing these types, if necessary. These types should be sufficiently wide that any pointer or scalar can be cast to these types, and then cast back, without loss of precision. */ typedef libi_uhostptr_t splay_tree_key; typedef libi_uhostptr_t splay_tree_value; However, arange-set.c in BFD uses splay-tree on bfd_vma: /* Get the low VMA address of a node. */ static bfd_vma arange_set_node_low (splay_tree_node node) { return (bfd_vma) node->key; } It doesn't work on 32bit host with 64bit VMA.
Created attachment 2083 [details] This patch works for me.
One way to fix it is to provide both long and long long interfaces for splay-tree with the old interface as default. Applications can choose which one to use. We can skip the long long one if compiler doesn't support long long.
A patch is posted at http://sourceware.org/ml/binutils/2007-11/msg00135.html
2 patches are posted at http://sourceware.org/ml/binutils/2007-11/msg00145.html http://sourceware.org/ml/binutils/2007-11/msg00158.html
A patch is posted at http://sourceware.org/ml/binutils/2008-02/msg00068.html
As of http://sourceware.org/ml/binutils-cvs/2008-02/msg00052.html http://sourceware.org/ml/binutils-cvs/2008-02/msg00053.html BFD no longer uses splay-tree.c, so this is no longer a ld bug.